Environment: centos 6.5 64bit 192.168.1.9 (master) 192.168.1.10 (slave)
Software version: bind9
Prerequisites: disable the firewall (or allow udp tcp port 53 953) and selinux.
The master server configuration is not described here. You can view the previous steps. Only the slave server configuration is recorded here.
1. Install bind and set it to boot.
Yum install bind-y
Set boot start, which is not started by default.
Chkconfig named on
2. Configure the bind configuration file of the slave server. In addition to the IP address and who is allowed to call it, the configuration of zone is as follows:
The configuration is as follows:
Options {
Listen-on port 53 {192.168.1.10 ;};
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;
};
Logging {
Channel default_debug {
File "data/named. run ";
Severity dynamic;
};
};
Zone "111cn.net "{
Type slave;
Masters {192.168.1.9 ;};
File "slaves/111cn.net. zone ";
};
There are three points to note in zone configuration. One is to change the type to slave, the other is to specify the master (pay attention to punctuation), and the other is to specify the zone location.
After the configuration is complete, restart it. If the configuration is successful, we can go to the/var/names/slaves directory to see 111cn.net. zone, which will automatically capture the zone file under the master. If it does not exist after restart, it indicates that the master/slave configuration is not successful. Check whether the firewall, selinux, or slaves permissions are correct.
After the restart, we can see that it has been captured:
[Root @ web10 ~] # Cd/var/named/slaves/
[Root @ web10 slaves] # ls
111cn.net. zone
[Root @ web10 slaves] # cat 111cn.net. zone
$ ORIGIN.
$ TTL 86400; 1 day
111cn.net in soa 111cn.net. rname. invalid .(
0; serial
86400; refresh (1 day)
3600; retry (1 hour)
604800; expire (1 week)
10800; minimum (3 hours)
)
NS 111cn.net.
A 127.0.0.1
AAAA: 1
$ ORIGIN 111cn.net.
Bbs CNAME www
Www A 192.168.1.9
3. Test whether the slave server can be properly parsed. The local Machine/etc/resolve. conf changes the nameserver to the slave server IP address 192.168.1.10 to test whether the resolution can be normal.
The current win host is an intranet connection with the master/slave dns, so we can test it directly through the win host. For example, in dos, we can use nslookup to test:
C: \ Users \ Administrator> nslookup
Default server: UnKnown
Address: fe80: 1
& Gt; server 192.168.1.10
Default server: [192.168.1.10]
Address: 192.168.1.10
& Gt; set type = any
& Gt; www.111cn.net
Server: [192.168.1.10]
Address: 192.168.1.10
Www.111cn.net internet address = 192.168.1.9
111cn.net nameserver = 111cn.net
111cn.net internet address = 127.0.0.1
111cn.net AAAA IPv6 address =: 1
It can be seen that the resolution is successful. The dns master/slave configuration is complete.