Difference between revisions of "Multiple DNS server configuration"
m |
m |
||
Line 14: | Line 14: | ||
where <IP> should be IP address of example.org DNS server which would resolve all example.org requests. | where <IP> should be IP address of example.org DNS server which would resolve all example.org requests. | ||
==Different DNS for sub-zone== | |||
To delegate a sub-zone to a different DNS appropriate records have to be entered in the zone file of parent zone. This can be done as follows: | |||
<pre> | |||
$ORIGIN <sub-zone>. | |||
@ IN NS ns1.<sub-zone>. | |||
IN NS ns2.<sub-zone>. | |||
ns1 IN A A.B.C.D. | |||
ns2 IN A P.Q.R.S | |||
</pre> | |||
Steps learned from http://stackoverflow.com/questions/15338232/how-to-forward-a-subzone | |||
Revision as of 09:11, 12 August 2014
<yambe:breadcrumb>Bind_DNS_server_configuration|Bind DNS</yambe:breadcrumb>
Multiple DNS server configuration
Different DNS for different zone
It is possible for an organization to have many internal DNS servers serving different domains. Assume the domains to be example.com and example.org. Now if a client requests example.com DNS server for example.org address resolution then the request may be resolved as a public request, because example.com server will treat example.org same as yahoo.com or google.co.in. To ensure that such requests also get resolved locally both example.com and example.org servers should have both example.org and example.com zones. Now example.com server should have following entry in its 'named.conf' file:
zone "example.org." { type forward; forwarders { <IP>; }; };
where <IP> should be IP address of example.org DNS server which would resolve all example.org requests.
Different DNS for sub-zone
To delegate a sub-zone to a different DNS appropriate records have to be entered in the zone file of parent zone. This can be done as follows:
$ORIGIN <sub-zone>. @ IN NS ns1.<sub-zone>. IN NS ns2.<sub-zone>. ns1 IN A A.B.C.D. ns2 IN A P.Q.R.S
Steps learned from http://stackoverflow.com/questions/15338232/how-to-forward-a-subzone
Primary and secondary DNS servers
Primary server zone configuration
Multiple DNS servers are most commonly created for backup so that if primary server is down secondary server can resolve all queries. To configure a primary server zone use:
zone "sbarjatiya.com." { type master; file "sbarjatiya.com.forward"; allow-transfer {192.168.2.114; 127.0.0.1; }; also-notify {192.168.2.114; }; allow-update {}; };
and replace 192.168.2.114 with actual secondary server IP. Multiple secondary servers can also be specified.
Secondary server zone configuration
To configure a secondary server zone use:
zone "sbarjatiya.com." { type slave; file "sbarjatiya.com.forward"; masters {192.168.2.106; }; allow-notify {192.168.2.106; }; allow-transfer {127.0.0.1; }; };
and replace 192.168.2.106 with actual primary server IP. Multiple primary servers can also be specified.
Editing zone records
To edit zone records use following steps:
- Log into primary server
- Edit zone file
- Use commands:
- rndc freeze sbarjatiya.com
- rndc reload sbarjatiya.com
- rndc thaw sbarjatiya.com
- Verify new serial number is reflected in primary server
- dig -t AXFR sbarjatiya.com @127.0.0.1
- Verify new serial number is reflected in secondary server using same dig command.
Steps learned from http://jon.netdork.net/2008/08/21/bind-dynamic-zones-and-updates/
<yambe:breadcrumb>Bind_DNS_server_configuration|Bind DNS</yambe:breadcrumb>