LinuxHelps.com

A blog for Linux Lovers.

Posted by sibu on March 3, 2009

DNS Server Setup..

DNS Server Setup

A name server translates domain names into IP addresses. This makes it possible for a user to access a website by typing in the domain name instead of the website’s actual IP address.
In order to run a `name server’, named daemon is needed. The files needed for configuring and running DNS (master and slave server) are:
1) /etc/named.conf
2) /var/named it’s a directory where the main database stays)
3) dnsconf utility

named configuration file (/etc/named.conf): It basically defines the parameters that point to the sources of domain database information, which can be local files or on remote servers.

Hint file (cache file)(/var/named/named.ca): It actually provides the name of root server which gets activated in case the machine name is not there in user defined zone.

localhost file (/var/named.local): All configuration have a local domain Database for resolving address to the host name localhost.

Now lets open /etc/named.conf
# This is the macro which defines where will the DNS related file stay.
Options {
directory “/var/named”;
};
# the line below says about the root servers or cache servers
zone “.” {
type hint;
file “named.ca”;
};

# This particular option tells about the file, which will keep hostname to Ipaddress mapping
zone “sibu.com.”{
type master;
file “/var/named/sibu.com.”;
};

/var/named/sibu.com contains

@ IN SOA ns1.server.com. root@serv.server.com. (
2000011301 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
sibu.com               IN     NS       ns1.server.com
sibu.com               IN     NS       ns1.server.com
sibu.com.              IN      A       192.168.0.1

@: It means current domain name.

In: This stands for Internet servers

SOA: This stands for `Start Of Authority’. This is the record that states that this server is authorative for the specified domain.

20000011301;serial: This is the serial number–a numeric value that tells or notifies the slave server, that the database has been updated. So slave server should also update it.

3600;refresh: This is the refresh cycle in seconds. In every refresh cycle the slave server comes to master server and checks for the updated database.

1800;retry: This particular line refers to the retry cycle which in turn means that the slave server should wait before asking the master server again in case master server doesn’t respond.

1209600;expire: In the event of a failure of the master DNS server, a slave server will continue to use its existing data for this period of time. After the expire time has passed, the data are considered stale and will not be used at which time the domain will no loger resolve. This value should be long enough to allow master server outages to be corrected, on the order of weeks.

432100;default_ttl: This refers to the default time to leave, for this domain to work for, when named is once started. Remember the user doesn’t have to play with this unless he wants that the query time from the slave server should be somewhat less or more. In case we want to change, we should change only the refresh time in both master and slave. The best way is to make it 2, which means after each 2 seconds slave server will query to master server.

Add A Comment

Powered By Wordpress - Theme Provided By Wordpress Themes - Auto Loan Credit