Difference between revisions of "Multiple DNS server configuration"
(Created page with "<yambe:breadcrumb>Bind_DNS_server_configuration|Bind DNS</yambe:breadcrumb> =Multiple DNS server configuration= It is possible for an organization to have many internal DNS s...") |
m |
||
Line 1: | Line 1: | ||
<yambe:breadcrumb>Bind_DNS_server_configuration|Bind DNS</yambe:breadcrumb> | <yambe:breadcrumb>Bind_DNS_server_configuration|Bind DNS</yambe:breadcrumb> | ||
=Multiple DNS server configuration= | =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 '<tt>named.conf</tt>' file: | 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 '<tt>named.conf</tt>' file: | ||
Line 11: | Line 13: | ||
</pre> | </pre> | ||
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. | ||
==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: | |||
<pre> | |||
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 {}; | |||
}; | |||
</pre> | |||
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: | |||
<pre> | |||
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; }; | |||
}; | |||
</pre> | |||
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: | |||
#:<pre> | |||
#::rndc freeze sbarjatiya.com | |||
#::rndc reload sbarjatiya.com | |||
#::rndc thaw sbarjatiya.com | |||
#:</pre> | |||
# Verify new serial number is reflected in primary server | |||
#:<pre> | |||
#::dig -t AXFR sbarjatiya.com @127.0.0.1 | |||
#:</pre> | |||
# Verify new serial number is reflected in secondary server using same dig command. | |||
<yambe:breadcrumb>Bind_DNS_server_configuration|Bind DNS</yambe:breadcrumb> |
Revision as of 05:22, 23 April 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.
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.
<yambe:breadcrumb>Bind_DNS_server_configuration|Bind DNS</yambe:breadcrumb>