You are here
Home > Redhat > How to configure Dns in linux

How to configure Dns in linux

DNS

package name : bind
 

service name : named
 

configuration file : /etc/named.conf
 

zone files : /var/named/chroot/var/named/
 

port :53
 

configuration file for dns forward zone and reverse zone: /etc/named.conf
 

zone “ trial.com” in {
 

type master;
 

file “trial.fwd”;
 

allow-query { any; };
 

};

 

zone “100.168.192-in.addr.arpa “ in {
 

type master;
 

file “trial.rev”
 

allow-query { any; };
 

};

 

Forward zone file (trial.fwd)
 

$TTL 1W
 

@ IN SOA ns1.trial.com. root.trial.com. (
 

2009090901 ; serial (d. adams)
 

15M ; refresh
 

10M ; retry
 

6W ; expiry
 

1W ) ; minimum
 

 

@ IN NS ns1.trial.com.
 

ns1 IN A 192.168.100.7
 

trial.com. IN A 92.168.100.7

 

Reverse zone file (trial.rev)

$TTL 1W
 

@ IN SOA ns1.trial.com. root.trial.com. (
 

2009090901 ; serial (d. adams)
 

15M ; refresh
 

10M ; retry
 

6W ; expiry
 

1W ) ; minimum
 

 

@ IN NS s1.trial.com.
 

7 IN PTR ns1.trial.com.
 

7 IN PTR trial.com.
 

The Hostmaster

As with most things on the Internet, it is common practice to provide a technical contact for the service. In this case, it is the e-mail address root.trial.com. You will notice that there is no @ sign in the e-mail address, but a full stop (period). The hostmaster for the trial.com zone is root.trial.com (root@trial.com).
 

Serial Number

The first entry is the serial number for the zone. This is one of the most important parts of the SOA because it must be changed any time you edit the zone file. It is the serial number that tells other DNS servers that are querying your DNS server that data has changed. If you do not change the serial number, your changes will not get propagated through the system.
 

The general form of the serial number is the date, followed by an arbitrary number. For the 24th of July, you use 2007072401 (July 24, 2007). Notice that the date is in the format yyyymmdd, with the year (2007), month (07), and day (24), with an additional two digits able to represent multiple changes in one day.
 

The Refresh Rate
 

If you have a slave DNS server in your system (as a backup to your master), the refresh rate tells the slave server how often to check for updates to the zone. .
 

Retry
 

If you have a slave DNS server in your system (as a backup to your master), the reftry rate tells the slave server to retry for refresh if refresh fails to check for updates to the zone.
 

Coniguration for slave domain
 

vi /etc/named.conf
 

zone “ trial.com” in {
 

type slave;
 

file “trial.fwd”;
 

masters { master ip; };
 

};

 

zone “100.168.192-in.addr.arpa “ in {
 

type slave;
 

file “trial.rev";
 

masters { master ip; };
 

};
 

The three very useful tools available for troubleshooting DNS problems that are included with BIND are
 

nslookup
 

nslookup domain name or ipaddress
 

host
 

host domain.name

dig
 

dig @localhost domain.name ( for forward zone )
 

dig -x ipaddress @localhost ( for reverse zone )
 

options to enter in zone
 

allow-query Accepts queries only from hosts in the address list (by default queries are accepted from any host).
 

Usage: allow-query {“address-list”};.
 

allow-transfer Zone transfers are accepted only by hosts in the address list (by default transfers are allowed to all hosts).
 

Usage: allow-transfer {“address list”};.
 

auth-nxdomain The server responds as an authoritative server (defaults to yes).
 

Usage: auth-nxdomain “yes or no”; (choose one).
 

check-names Host names are checked for compliance with the RFC.
 

Usage: check-names “master or slave or response warn or fail or ignore”; (choose one from each group).
 

cleaning-interval Specifies the time period before expired resource records are removed by the server (defaults to 60 minutes).
 

Usage: cleaning-interval “number”; (specify number in minutes).
 

coresize Specifies largest size for core dump files.
 

Usage: coresize “size”; (specify size in bytes).
 

datasize Limits server memory usage.
 

Usage: datasize “size”; (specify size in bytes).
 

deallocate-on-exit Detects memory leaks (default is no).
 

Usage: deallocate-on-exit “yes or no”; (choose one).
 

directory Path of the directory where server configuration files are located.
 

Usage: directory “path to directory”; (specify path).
 

dump-file If named receives a SIGINT signal, it dumps the database to the file specified here (defaults to named_dump.db).
 

fake-iquery If set to yes, the server sends a fake reply to inverse queries rather than an error (default is no).
 

Usage: fake-iquery “ yes or no”; (choose one).
 

fetch-glue If set to yes, the server obtains the glue records for a response (default is yes).
 

Usage: fetch-glue “yes or no”; (choose one).
 

files Limits number of concurrently open files (default is unlimited).
 

Usage: files “number”; (specify number).
 

forward If set to first, the servers listed in the forwarders option are queried first, and then the server tries to find the answer itself.
 

If set to only, just the servers in the forwarders list are queried.
 

Usage: forward “first or only”; (choose one).
 

forwarders Shows IP addresses of servers to forward queries (default is none).
 

Usage: forwarders “IP addresses of servers”; (specify IP addresses).
 

host-statistics If set to yes the server keeps statistics on hosts (default is no).
 

Usage: host-statistics “yes or no”; (choose one).
 

interface-interval Specifies interval for searching the network for new or removed interfaces (default is 60 minutes).
 

Usage: interface-interval “time”; (specify time in minutes).
 

listen-on Specifies port and interfaces on which server listens for queries (default is port 53).
 

Usage: listen-on “port {address list}”; (specify port number and address list).
 

transfers-in Maximum concurrent inbound zone transfers (default is 10).
 

Usage: transfers-in “number”; (specify the number).
 

transfers-out Maximum concurrent outbound transfers.
 

Usage: transfers-out “number”; (specify the number).
 

transfers-per-ns Limits inbound transfers from a single server (default is two).
 

Usage: transfers-per-ns “number”; (specify the number).
 

Leave a Reply

15 − 9 =

Top