Build NDS server (bind) in centos6.8)
1. Install software
[root@dns-server named]# yum install bind -y[root@dns-server named]# /etc/init.d/named startStarting named: [ OK ][root@dns-server named]#
2. Configure the name parameter
[Root @ dns-server named] # cat/etc/named. conf // named. conf /// Provided by Red Hat bind package to configure the isc bind named (8) DNS // server as a caching only nameserver (as a localhost DNS resolver only ). /// See/usr/share/doc/bind */sample/for example named configuration files. // options {listen-on port 53 {192.168.17.149;}; # modify to the IP address listen-on-v6 port 53 of the Local Machine {: 1 ;}; directory "/var/named "; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt "; memstatistics-file "/var/named/data/named_mem_stats.txt"; allow-query {any ;}; # change to any recursion yes; dnssec-enable yes; dnssec-validation yes; /* Path to isc dlv key */bindkeys-file "/etc/named. iscdlv. key "; managed-keys-directory"/var/named/dynamic ";}; logging {channel default_debug {file" data/named. run "; severity dynamic ;};}; zone ". "IN {type hint; file" named. ca ";};# Add the forward zone" test.com "IN {type master; file" test.com. zone ";};# Add a reverse zone" 1.168.192.in-addr. arpa. "IN {type master; file" 1.168.192.zone ";}; include"/etc/named. rfc1912.zones "; include"/etc/named. root. key ";
3. configure a forward/reverse File
[root@dns-server named]# cd /var/named/[root@dns-server named]# pwd/var/named
Forward File
[root@dns-server named]# cat test.com.zone $TTL 1D@ IN SOA dns.test.com. root.test.com.( 20160529 1H 15M 1W 1D)@ IN NS dns.test.com.dns IN A 192.168.1.2cw IN A 192.168.1.11xs IN A 192.168.1.12jl IN A 192.168.1.13oa IN A 192.168.1.13[root@dns-server named]#
Reverse File
[root@dns-server named]# cat 1.168.192.zone $TTL 86400@ IN SOA 1.168.192.in-addr.arpa. root.test.com.( 20160529 1H 15M 1W 1D)@ IN NS dns.test.com.2 IN PTR dns.test.com.11 IN PTR cw.test.com.12 IN PTR xs.test.com.13 IN PTR jl.test.com.13 IN PTR oa.test.com.
Iv. Test DNS resolution
[root@dns-server named]# nslookup > dns.test.comServer: 192.168.17.149Address: 192.168.17.149#53Name: dns.test.comAddress: 192.168.1.2> cw.test.comServer: 192.168.17.149Address: 192.168.17.149#53Name: cw.test.comAddress: 192.168.1.11> 192.168.1.13Server: 192.168.17.149Address: 192.168.17.149#5313.1.168.192.in-addr.arpa name = jl.test.com.13.1.168.192.in-addr.arpa name = oa.test.com.> 192.168.1.12Server: 192.168.17.149Address: 192.168.17.149#5312.1.168.192.in-addr.arpa name = xs.test.com.