You are on page 1of 3

Configure dns server configuration file

The dns master configuration file is named.conf. Its location is /etc/named.conf. We better backup this file first for safety reason if we screw up later. root@slackware:/etc# cp named.conf named.conf.bac root@slackware:/etc# ls -l | grep named.conf -rw-r--r-- 1 root root 681 2008-04-14 06:07 named.conf -rw-r--r-- 1 root root 681 2008-12-01 01:13 named.conf.bak root@slackware:/etc#

Let's view the named.conf file with less command:

options { directory "/var/named"; /* * If there is a firewall between you and nameservers you want * to talk to, you might need to uncomment the query-source * directive below. Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default. */ // query-source address * port 53; /* * ISP dns server ip address */ forward first; forwarders { 200.188.1.123; 200.188.1.124; }; }; // // a caching only nameserver config // zone "." IN { type hint; file "caching-example/named.root"; }; zone "localhost" IN { type master; file "caching-example/localhost.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa" IN { type master; file "caching-example/named.local"; allow-update { none; }; };

This is the default named.conf configuration. By default, named.conf file only configured for localhost. So we need to edit or add our domain in this file later. We also need to create new dns zone files for our domain. We can see that all dns zone files were kept in /var/named/caching-example directory. So let's view /var/named/caching-example directory: root@slackware:/etc# ls -l /var/named/caching-example/ total 16 -rw-r--r-- 1 root root 195 2008-09-17 15:26 localhost.zone -rw-r--r-- 1 root root 2878 2008-09-17 15:26 named.ca -rw-r--r-- 1 root root 433 2008-09-17 15:26 named.local -rw-r--r-- 1 root root 2878 2008-09-17 15:26 named.root root@slackware:/etc#

Setup additional dns zones


You know that to setup dns you need a qualified domain name? That's true but not totally true. You can setup local BIND caching name server for your local network to speed up dns lookups, which in turn will speed up all of your Internet services. Here are examples of default configuration zone files for bind dns server: This is localhost.zone file default configuration. It is configured for localhost: $TTL 86400 $ORIGIN localhost. @

1D IN SOA

@ root ( 42 3H 15M 1W 1D ) @ 127.0.0.1

; ; ; ; ;

serial (d. adams) refresh retry expiry minimum

1D IN NS 1D IN A

This is named.local file default configuration. As you can see in the /etc/named.conf file configuration above, this is the reverse dns configuration file, also configured for localhost: $TTL @ 86400 IN

SOA

IN 1 IN PTR

localhost. root.localhost. 1997022700 ; 28800 ; 14400 ; 3600000 ; 86400 ) ; NS localhost. localhost.

( Serial Refresh Retry Expire Minimum

When we added our new domain, we'll just need to copy and configure these two files to setup bind dns server, for private dns or public dns. We leave alone the cache zone file, named.ca and the master list of the root name servers, named.root. Well, the named.root should be update from time to time though. Normally once a month because it does not change very often. Get latest update named.root from ftp.internic.net.

You might also like