Centos6.8 set up NDS Server (bind)

First, install the software

[root@dns-server named]# yum install bind -y [root@dns-server named]# /etc/init.d/named start Starting named: [ OK ] [root@dns-server named]#

Second, the configuration 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 {; }; #修改为本机的ip地址 listen-on-v6 port 53 { ::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; }; #修改为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”; }; #添加正向区域 zone “test.com” IN { type master; file “test.com.zone”; }; #添加反向区域 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”;

Three to a file, configuration, pros and cons

[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 cw IN A xs IN A jl IN A oa IN A [root@dns-server named]#

Reverse documents

[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.

Four, test DNS resolution
[root@dns-server named]# nslookup > dns.test.com Server: Address: Name: dns.test.com Address: > cw.test.com Server: Address: Name: cw.test.com Address: > Server: Address: name = jl.test.com. name = oa.test.com. > Server: Address: name = xs.test.com.