Professional Documents
Culture Documents
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#
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#
1D IN SOA
; ; ; ; ;
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
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.