DNS Server Configuration There are the files which must be configure if you want to make you LINUX operating system as Server. The three files are as follows: 1. /etc/resolv.conf 2. /etc/named.conf 3. /etc/hosts
/etc/resolv.conf: The initial structure of this file is as follows : ### BEGIN INFO # # ### END INFO # nameserver 127.0.0.1 search localhost When you want to configure your linux server then the basic change that you made on this file are as follows: ### BEGIN INFO # # ### END INFO # nameserver 172.31.1.30 nameserver 172.31.1.62 nameserver 172.17.14.47 nameserver 202.54.15.1 nameserver 172.16.1.1 search cc21447.iiita.ac.in
/etc/named.conf :The initial structure of this file is as follows: # The following zone definitions don't need any modification. The first one # is the definition of the root name servers. The second one defines # localhost while the third defines the reverse lookup for localhost. zone "." in { type hint; file "root.hint"; }; zone "localhost" in { type master; file "localhost.zone"; }; zone "0.0.127.in-addr.arpa" in { type master; file "127.0.0.zone"; }; # Include the meta include file generated by createNamedConfInclude. # includes all files as configured in NAMED_CONF_INCLUDE_FILES from # /etc/sysconfig/named
This
include "/etc/named.conf.include"; # # # #
You can insert further zone records for your own domains below or create single files in /etc/named.d/ and add the file names to NAMED_CONF_INCLUDE_FILES. See /usr/share/doc/packages/bind/README.SUSE for more details.
After the configureation of DNS we have new zone file which look like as # The following zone definitions don't need any modification. The first one # is the definition of the root name servers. The second one defines # localhost while the third defines the reverse lookup for localhost. zone "." in { type hint; file "root.hint"; }; zone "localhost" in { type master; file "localhost.zone"; }; zone "0.0.127.in-addr.arpa" in { type master; file "127.0.0.zone";
}; Zone “” in{ Type master; File “
This
include "/etc/named.conf.include"; # # # #
You can insert further zone records for your own domains below or create single files in /etc/named.d/ and add the file names to NAMED_CONF_INCLUDE_FILES. See /usr/share/doc/packages/bind/README.SUSE for more details.
Zone File for farward lookup file we follow the following structure $TTL 3D @
IN
SOA
ns1.cc21447.iiita.ac.in.
20080911
; Serial
3600
; Refresh, Seconds
3600
; Retry, Seconds
3600
; Expire, Seconds
3600 )
; Minimum, Seconds
NS
www
cc21447.iita.ac.in. localhost
MX A
; Inet Address of nameserver 1 mail
A
172.31.1.30
dns1
A
172.31.1.62
cc21447
A
172.17.14.47
cc21447
A
172.16.1.1
www mail
; Primary mail exchanger
127.0.0.1
dns0
ns1
root.cc21447.iiita.ac.in. (
CNAME cc21447 CNAME cc21447 CNAME cc21447
for the backward lookup or reverse lookup file we follow the following structure
$TTL 3D @
IN
SOA
www.cc21447.iiita.ac.in. 20080911
root.cc21447.iiita.ac.in. (
;Serial Number
8H
; Refresh, Seconds
2H
; Retry, Seconds
4W
; Expire, Seconds
1D )
; Minimum, seconds
NS
www
;Nameserver Address
62
PTR
dns1.iiita.ac.in.
30
PTR
dns0.iiita.ac.in.
47
PTR
cc21447.iiita.ac.in.
1
PTR
cc21447.iiita.ac.in.
1
PTR
ns1.cc21447.iiita.ac.in.
1
PTR
mail.cc21447.iiita.ac.in.
After doing all this setting we restart all the service.
Configure the /etc/hosts After configure the two above files we then configure one more file that is /etc/hosts at the very first stage the lookup of hosts file are as follows: # # hosts
This file describes a number of hostname-to-address
#
mappings for the TCP/IP subsystem. It is mostly
#
used at boot time, when no name servers are running.
#
On small systems, this file can be used instead of a
#
"named" name server.
# Syntax: # # IP-Address Full-Qualified-Hostname Short-Hostname # 127.0.0.1
localhost
# special IPv6 addresses ::1
localhost ipv6-localhost ipv6-loopback
when we configure our hosts file then it looks like as following : # # hosts
This file describes a number of hostname-to-address
#
mappings for the TCP/IP subsystem. It is mostly
#
used at boot time, when no name servers are running.
#
On small systems, this file can be used instead of a
#
"named" name server.
# Syntax: # # IP-Address Full-Qualified-Hostname Short-Hostname # 127.0.0.1
localhost
# special IPv6 addresses ::1
localhost ipv6-localhost ipv6-loopback
fe00::0
ipv6-localnet
ff00::0
ipv6-mcastprefix
ff02::1
ipv6-allnodes
ff02::2
ipv6-allrouters
ff02::3
ipv6-allhosts
#127.0.0.2
spine.spine.iiita.ac.in spine
172.31.1.31
dns0.iiita.ac.in
172.31.1.62
dns1.iiita.ac.in
#127.0.0.2
spine.spine.iiita.ac.in spine
172.16.1.1
cc21447 cc21447.iiita.ac.in
172.17.14.47
cc21447 cc21447.iita.ac.in
#127.0.0.2
cc21447.cc21447.iiita.ac.in cc21447
After configuring all these file yours DNS are ready to go . Good luck Amar Prakash Srivastava
MSCLIS Indian Institute of technology, Allahabad