Documente Academic
Documente Profesional
Documente Cultură
com
Originally published on
LinuxTechLab.com
Hello, Linux-fanatics. Earlier we learned to create a DNS server for our environment
using BIND with single or Master server setup. Now, in this tutorial we will discuss
how we can create a master slave DNS server setup.
In Master Slave DNS setup when a slave is created, it obtains an identical copy of all
master records using zone transfer method. Master-slave have easy replication
mechanism, as soon as a change is made on Master server, it notifies the slave & slave
then fetches the data. All process taking mere seconds.
Scenario
We have already discussed how we can create a Master server. If you have not done that
already, please do that by following this tutorial. We will then make some changes to
Master server.
On master DNS, we will make changes to /etc/named.conf file to allow zone transfer to
slave server & also to notify slave server when changes have been made to master.
this will allow the zone transfer to slave server. Next we will make changes to allow
master to notify of changes made to slave server by adding following lines in
named.conf only
zone ltechlab.com IN {
type master;
file fwd.ltechlab.com.db;
allow-update { none; };
notify yes;
also-notify { 192.168.1.110; };
};
Here, notify yes & also-notify { 192.168.1.110; }; will allow notification to be sent to
slave server (192.168.1.110) & slave will then fetch the updated information.
Next, we will update the slave DNS information in our forward zone file. Open
/var/named/ fwd.ltechlab.com.db & make the following changes
$TTL 86400
@ IN SOA dns.ltechlab.com. root.ltechlab.com. (
2014112512 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
;Name Server Information
@ IN NS dns.ltechlab.com.
Secondary Name server
@ IN NS slave.ltechlab.com.
;IP address of Name Server
primary IN A 192.168.1.100
;IP address of secondary server
secondary IN A 192.168.1.110
;Mail exchanger
ltechlab.com. IN MX 10 mail.ltechlab.com.
;A Record HostName To Ip Address
www IN A 192.168.1.105
mail IN A 192.168.1.120
;CNAME record
ftp IN CNAME www.ltechlab.com.
After these changes are made, restart your BIND service for changes to take effect.
After the package has been installed, we will now edit /etc/named.conf . Open
named.conf & comment the following lines
#listen-on port 53 { 127.0.0.1; };
#listen-on-v6 port 53 { :!! };
Then we will add our network, to allow clients from our network to make query to DNS.
Lastly , we will verify our zone file with dig command, as we did for our master DNS
server
We now have our Master Slave DNS setup ready. Everytime we make an update to
master, master will notify slave which in turn will fetch the update, thus keeping both
master-slave in sync.
If you think we have helped you or just want to support us, please consider these :-
Connect to us: Facebook | Twitter | Google Plus
LinuxTechLab.com