Case Environment:
Primary Domain Name server: ns1.zdj.com,172.17.0.142
From the domain name server: ns2.zdj.com,172.17.0.37
Both servers are capable of providing domain name resolution for zdj.com zones
Primary Domain Name server: 1. ip:172.17.0.142
[[email protected] var]# vim/var/named/chroot/etc/named.rfc1912.zones----Add the following:
Zone "Zdj.com" in {
Type master;
File "zdj.com";
allow-transfer{172.17.0.37;};
};
Zone "0.17.172.in-addr.arpa" in {
Type master;
File "172.17.0.zone";
Allow-transfer {172.17.0.37;};
};
2.
[Email protected] named]# vim zdj.com--------Edit the following---forward parsing
$TTL 1D
@ in SOA ns1.zdj.com. Root.zdj.com. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
@ NS ns1.zdj.com.
@ NS ns2.zdj.com.
NS1 A 172.17.0.142
NS2 A 172.17.0.37
www A 172.17.0.123
www A 172.17.0.122
www A 172.17.0.124
Web CNAME www---------alias
* A 172.17.0.252
3.
[Ro[email protected] named]# vim 172.17.0.zone--------Edit the following-----reverse resolution
$TTL 1D
@ in SOA ns1.zdj.com. Root.zdj.com. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
@ NS ns1.zdj.com.
@ NS ns2.zdj.com.
142 PTR ns1.zdj.com.
Panax Notoginseng PTR ns2.zdj.com.
123 PTR www.zdj.com.
124 PTR www.zdj.com.
122 PTR www.zdj.com.
4.
[[email protected] named]# cat/etc/resolv.conf---------set up the DNS server for yourself, test with
; Generated By/sbin/dhclient-script
#nameserver 8.8.8.8
NameServer 172.17.0.142
5.
[Email protected] named]# service named RestaRt
From the domain name server: ip:172.17.0.37
1.
[[email protected] slaves] #vim/var/named/chroot/etc/named.conf
Options {
Listen-on Port 53 {172.17.0.37;};
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;};
recursion Yes;
# dnssec-enable Yes;
# dnssec-validation Yes;
# Dnssec-lookaside Auto;
/* Path to ISC DLV key */
# bindkeys-file "/etc/named.iscdlv.key";
};
2.
[[email protected] slaves] #vim/var/named/chroot/etc/named.rfc1912.zones------------Add the following
Zone "Zdj.com" in {
Type slave;
Masters {172.17.0.142;};
File "slaves/zdj.com";
};
Zone "0.17.172.in-addr.arpa" in {
Type slave;
Masters {172.17.0.142;};
File "Slaves/172.17.0.zone";
};
3.[[email protected] slaves] #service named restart
Test machine
[Email protected] ~]# vim/etc/resolv.conf
; Generated By/sbin/dhclient-script
#nameserver 59.51.78.211
#nameserver 222.246.129.81
NameServer 172.17.0.142
[Email protected] ~]# host www.zdj.com
Www.zdj.com has address 172.17.0.123
Www.zdj.com has address 172.17.0.124
Www.zdj.com has address 172.17.0.122
[Email protected] ~]# host 172.17.0.122
122.0.17.172.IN-ADDR.ARPA Domain name Pointer www.zdj.com
DNS master-Slave server implementation under Linux