how to configure secondary / slave name server
I'm following instructions here http://www.elinuxbook.com/how-to-con...bind-in-linux/ to set up a 2ndary name server. I've added the 'allow-transfer' directives to the named.conf file, now I'm a bit indecisive on the zone file. The example shows:
Code:
; name servers Code:
NS mail.hprs.local. To get my 2ndary DNS server specified, is all I need to do here is add: Code:
NS webserver.hprs.local. (I'm asking first before I just try it because I'm doing this remotely and I don't want to cut of the branch I'm sitting on!) |
Quote:
The 3rd A RR assigns an IP to the plain elinuxbook.com. It's not mandatory, but it's useful for example if you're going to run elinuxbook.com website (without the leading www). Quote:
|
1 Attachment(s)
OK, added the 2ndary name server to named.conf on "master" (192.168.0.2) and updated the zonefiles accordingly. I also created a named.conf on the "slave" machine (192.168.0.3) per that link's instructions. Slave named.conf is:
Code:
options { 1) The generated zonefiles are basically unreadable, unlike the zonefiles on the master (readable and editable with text editor), and unlike the example show in my howto link. See image. when I run: Code:
# named-checkzone hprs.local /var/named/db.hprs.local 2) Now that I supposedly have a secondary name server, how do hosts and workstations on the LAN actually *use* it? The master is also the DHCP server and it causes 192.168.0.2 to be plugged into DHCP clients' resolv.conf files. If that host goes down, how do other hosts know to use this 2ndary host for name resolution? |
Quote:
By default slave writes the zonefiles in raw format, so you need to use: Code:
named-checkzone -f raw hprs.local /var/named/db.hprs.local Quote:
|
Quote:
Code:
named-compilezone -f raw -F text -o - hprs.local /var/named/db.hprs.local Quote:
|
Yes, the dhcpd server did give both dns servers to the clients' resolv.conf. However, I had to add the 2ndary host (192.168.0.3) to the dhcpd.conf:
Code:
option domain-name-servers 192.168.0.2, 192.168.0.3; My final test will be to pull the Ethernet cable on the 192.168.0.2 primary DNS host and see if other LAN hosts can still resolve domain names, but that test will likely have to wait for a convenient time when that server can be taken offline. |
Quote:
|
Quote:
I have a couple of more questions ... The example site shows "recursion yes;" under options. I did not have this in my master named.conf and did not put it in my slave config. I've search for information on this and have found plenty of sites telling how to enable or disable "recursion", but I can't seem to find anything telling me what it is other than having to do with "recursive queries". What is recursion? What are "recursive queries? is 'recursion yes/no' related to 'allow-recursion { IP; };' and/or 'allow-recursion-on { IP; };'? Are these options interdependent? Should I set one or all of these in my slave config? My master named.conf has localhost zones defined: Code:
zone "localhost" IN { |
Quote:
If you want your nameserver to act also as a resolver for your clients, you should use the "allow-recursion ..." directive giving the IPs/networks of your clients, so you prevent abuse of your dns. For more details about recursion see this. Quote:
I cannot think of a client other than localhost itself that is going to query your dns about... localhost! So having localhost into /etc/hosts will be fine. |
Quote:
Quote:
Quote:
|
Quote:
Code:
allow-recursion {192.168.0.0/24;}; Quote:
Quote:
Better assign a static IP to the slave too |
Quote:
Quote:
|
Quote:
Using just "allow recursion {...};" and nothing else, it implies "recursion yes;" (the default), but it will allow recursion only to those host/networks specified. Regards |
OK ... I just tried a live test. I have a Windows 7 workstations/AD domain member. ipconfig shows 192.168.0.2 and 192.168.0.3 as DNS servers (where .2 is the original Master, and .3 is this new slave). I opened a browser on the workstation, unplugged the .2 server and ... nothing! I could not get to any web page until the .2 was plugged back in. :(
So, is something wrong in my slave config? What can I do to test/debug this? This is my complete slave named.conf Code:
options { |
Quote:
You get a timeout from the 2nd dns, a NXDOMAIN answer, or what? I'm not a windows user, so I did a little search. Many users claim that if the 1st dns is down, windows clients do not query the 2nd dns. M$ says it doesn't work this way, but after 3s the 2nd dns is queried! You may also look at this relevant post. |
All times are GMT -5. The time now is 10:18 AM. |