Problem
I am trying to configure DNS to be the primary nameserver for
multiple domains with all domains using the same network address
for their host's IPs. That is, all the domains' DNS entries will
be using the same network portion of the IP address.After setting up the primary nameserver for the domains, I notice
networking problems. Reverse lookups may fail; ftp, sendmail,
and other services may timeout; networking may slowdown overall. Cause
Only one file for "reverse" records (PTR records) should be used
for all the domains. Typically, we would list all A records for
a domain together in a file named something like "named.hosts",
and all PTR records would be together in a file named something
like "named.rev".Separate domains would usually get their own configuration files, so the domain "xyz.com" would have its A records in a file named something like "xyz.hosts", and its PTR records would typically be in "xyz.rev".
Solution
The file /etc/named.boot (OpenServer) or /etc/inet/named.boot
(UnixWare) should be rewritten so that all domains refer to the
same .rev file. That is, there will be one master .rev file for
all the domains, but each domain should get its own .hosts file.All A records can be split into separate domains, as usual.
Then, all PTR records for any domain should be put into this
master .rev file. Look at the "directory" listing in
/etc/named.boot to determine where the domains' configuration
files are. There should only be one .rev file for all domains
configured under this network address.You also need NS records for each virtual domain, each of which
refers to the primary (physical) domain name of the machine.
This is because named(ADMN) tends to respond to requests on the
primary IP number: if you make a DNS request to the virtual
domain's nameserver, and that nameserver has an IP number of
x.y.z.5, the nameserver will tend to respond on its physical IP
number of x.y.z.1 instead of the IP corresponding to the virtual
domain. Newer resolvers will reject the answer when they get a
response from an IP number that did not equal the IP number to
which they sent the request.Finally, the SOA entries for the virtual domains should refer to the primary domain of the host machine.
NOTE: In the examples that follow, lab1.phoenix.test1.COM and lab2.phoenix.test2.COM are the virtual domains and willow.test.COM is the primary DNS server and mail server. These files contain example domains and IP's that should be replaced by the actual domains and IP's you are using.
example of a master named.rev file in /etc/named.d:
$INCLUDE named.soa118 IN PTR willow.test.COM.
143 IN PTR lab1.phoenix.test1.COM.
58 IN PTR lab2.phoenix.test2.COM.
143 IN NS willow.test.COM.
58 IN NS willow.test.COM.example of a named.hosts file in /etc/named.d:
$INCLUDE named.soalocalhost IN A 127.0.0.1
IN MX 10 willow.test.COM.
willow IN A 10.1.1.118
IN MX 10 willow.test.COM.example of the lab1.hosts file in /etc/named.d:
$INCLUDE named.soalab1 IN A 10.1.1.143
IN MX 10 willow.test.COM.example of the lab2.hosts file in /etc/named.d:
$INCLUDE named.soalab2 IN A 10.1.1.58
IN MX 10 willow.test.COM.example of a named.soa file in /etc/named.d:
@ IN SOA willow.test.COM. (
6.4 ; Serial
10800 ; Refresh
1800 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS willow.test.COM.example of a named.boot file in /etc/:
directory /etc/named.d
primary test.COM named.hosts
primary phoenix.test1.COM lab1.hosts
primary phoenix.test2.COM lab2.hosts
primary 1.1.10.in-addr.arpa named.rev
primary 0.0.127.in-addr.arpa named.local
cache . root.cacheAside from named.boot, the actual filenames on your system may be different.
See also
Other articles in this database on multihoming and nameserver configuration, named(ADMN) manual pages.