Example: Let'S Say A System Administrator Wants To Setup 3 Ipaddresses With The Same Machine
Example: Let'S Say A System Administrator Wants To Setup 3 Ipaddresses With The Same Machine
And in the same way the reverse zone file also has the above things. The reverse zone file of master
server that is 192.192.192.reverse may look like
@ IN SOA kshounish2.love.com. [email protected]. (
2000011301 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
@ IN NS kshounish1.bigleap.com
1 IN PTR kshounish1.bigleap.com.
2 IN PTR kshounish2.bigleap.com.
3 IN PTR kshounish3.bigleap.com.
4 IN PTR kshounish4.bigleap.com.
5 IN PTR kshounish5.bigleap.com.
6 IN PTR kshounish6.bigleap.com.
7 IN PTR kshounish7.bigleap.com.
8 IN PTR kshounish8.bigleap.com.
9 IN PTR kshounish9.bigleap.com.
10 IN PTR kshounish10.bigleap.com.
Note: Because the network id is already determined by @ that is 192.192.192.reverse, 1. replaces
the reverse.10.
So, once the master server zone file and master server reverse zone file is configured well, just start
#/etc/rc.d/init.d/named restart
Now our master server is configured. So, if any machine has its name server lookup as
192.192.192.1, we will be able to access it by a command called nslookup.
Slave server configuration
We want to configure a slave server as kshounish2.bigleap.com. of kshounish1.bigleap.com.
Slave Server setup: We go to dnsconf and configure secondaries option. It will ask for the master
server. We write kshounish1.bigleap.com/ and save it
If your slave server has domain as bigleap.com. and whose master is kshounish1.bigleap.com, then
the /etc/named.conf at slave server should look like:
#this is the macro which defines where will the DNS related file stay
options {
directory “/var/named”;
};
#the below line says about the root servers or cache servers
zone “.” {
type hint;
file “named.ca”;
};
# this particular option tells about the file which will keep hostname to ipaddress mapping got from
master server
zone “bigleap.com.”{
type slave;
file “slave/bigleap.com.”;
masters { kshounish1.bigleap.com;};
};
# this particular option tells about the localhost file mapping
zone “0.0.127.in-addr.arpa”{
type master;
file “named.local”;
};
# this particular option tells about the file which will keep ippaddress to #hostname mapping
zone “192.192.192.IN-ADDR.ARPA”{
type slave;
file “slave/192.192.192.reverse”;
masters {kshounish1.bigleap.com}
};
If we go by dnsconf, it will create a slave under /var/named and then it will keep the files under it.
After we have done this just start the daemon
#/etc/rc.d/init.d/named restart (in kshounish2.bigleap.com.)
Similarly, for slave’s slave configuration, we can simply make another slave as
kshounish4.bigleap.com saying that its master will be kshounish2.bigleap.com.
Remember
Whenever you do a new entry in zone file or reverse zone file of the master, always add 1 to the
serial number and the restart daemon #/etc/rc.d/init.d/named restart.
But there is no need to restart the slave daemon.
Example:
Lets take the previous master file and updated master file and see the change in it
Normal database:
@ IN SOA kshounish2.love.com. [email protected]. (
2000011301 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
@ IN NS kshounish1.bigleap.com
kshounish1.bigleap.com IN A 192.192.192.1
kshounish2.bigleap.com IN A 192.192.192.2
kshounish3.bigleap.com IN A 192.192.192.3
kshounish4.bigleap.com IN A 192.192.192.4
kshounish5.bigleap.com IN A 192.192.192.5
kshounish5.bigleap.com IN A 192.192.192.6
kshounish7.bigleap.com IN A 192.192.192.7
kshounish8.bigleap.com IN A 192.192.192.8
kshounish9.bigleap.com IN A 192.192.192.9
kshounish10.bigleap.com IN A 192.192.192.10
@ IN SOA kshounish2.love.com. [email protected]. (
2000011301 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
@ IN NS kshounish1.bigleap.com
1 IN PTR kshounish1.bigleap.com.
2 IN PTR kshounish2.bigleap.com.
3 IN PTR kshounish3.bigleap.com.
4 IN PTR kshounish4.bigleap.com.
5 IN PTR kshounish5.bigleap.com.
6 IN PTR kshounish6.bigleap.com.
7 IN PTR kshounish7.bigleap.com.
8 IN PTR kshounish8.bigleap.com.
9 IN PTR kshounish9.bigleap.com.
10 IN PTR kshounish10.bigleap.com.
Updated database:
@ IN SOA kshounish2.love.com. [email protected]. (
2000011302 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
@ IN NS kshounish1.bigleap.com
kshounish1.bigleap.com IN A 192.192.192.1
kshounish2.bigleap.com IN A 192.192.192.2
kshounish3.bigleap.com IN A 192.192.192.3
kshounish4.bigleap.com IN A 192.192.192.4
kshounish5.bigleap.com IN A 192.192.192.5
kshounish5.bigleap.com IN A 192.192.192.6
kshounish7.bigleap.com IN A 192.192.192.7
kshounish8.bigleap.com IN A 192.192.192.8
kshounish9.bigleap.com IN A 192.192.192.9
kshounish10.bigleap.com IN A 192.192.192.10
kshounish11.bigleap.com IN A 192.192.192.11
@ IN SOA kshounish2.love.com. [email protected]. (
2000011302 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
@ IN NS kshounish1.bigleap.com
1 IN PTR kshounish1.bigleap.com
2 IN PTR kshounish2.bigleap.com
3 IN PTR kshounish3.bigleap.com
4 IN PTR kshounish4.bigleap.com
5 IN PTR kshounish5.bigleap.com
6 IN PTR kshounish6.bigleap.com
7 IN PTR kshounish7.bigleap.com
8 IN PTR kshounish8.bigleap.com
9 IN PTR kshounish9.bigleap.com
10 IN PTR kshounish10.bigleap.com
11 IN PTR kshounish11.bigleap.com
You must have noticed that after adding the new machine we have changed the serial number from
2000011301 to 2000011302. This is done because the slave server updates its database from
master. It finds that its serial number is smaller than the master server and when you change the
serial number while the slave server queries for updating, its serial number changes automatically
as a result of which the slave’s slave also changes.