Operating System - HP-UX
1848482 Members
7191 Online
104029 Solutions
New Discussion

DNS Domains - How to get two domains to share data

 
SOLVED
Go to solution
UNIX Engr
Advisor

DNS Domains - How to get two domains to share data

My company just aquired another company. Both have separate primary dns servers running on their internal networks. Both internal networks maintain unique internal IP addressing structures with the same subnet mask. (255.255.252.0) Company A.com - 10.15.X.X and Company B.com - 10.171.X.X. I must maintain both DNS servers for the time being. How do I get DNS requests from users at Company B forwarded to Company A's DNS Server and vis-a-versa?
6 REPLIES 6
S.K. Chan
Honored Contributor

Re: DNS Domains - How to get two domains to share data

I think you can define the "search" definition in /etc/resolv.conf to achieve this. Do ..
# man 4 resolver
for more details

From the man pages ..
"Search list for host-name lookup. If the search option is not used the search list will contain only the the local domain name. The search list can be changed by listing the desired domain search path following the search keyword with spaces or tabs separating the names. Most ..."
Mark Greene_1
Honored Contributor

Re: DNS Domains - How to get two domains to share data

you need to add a "forwards" entry to your named.boot/named.conf depending on the version of bind on your server.

See the man page for "named", you should see and example like this:

forwarders 10.0.0.78 10.2.0.78

substitute the ip addresses as appropriate.

HTH
mark
the future will be a lot like now, only later
Sachin Patel
Honored Contributor

Re: DNS Domains - How to get two domains to share data

You can use forwarder options in /etc/named.conf (if it is version grater then 4.9.7)

forwarders {
198.6.100.25; }; i.e ip of another server.

Another way
you can set server A.A.com as a secondary server for B.com domain and vice versa.

On server A
zone "B.com" {
type slave;
file "sec.hosts.B.com";
masters {
Ip_of B;};
};


Sachin
Is photography a hobby or another way to spend $
Jordan Bean
Honored Contributor

Re: DNS Domains - How to get two domains to share data

Perhaps the solution is as easy as creating slave zones on each dns server and configuring host resolvers as necessary.

For example, let's assume HPUX and BIND4, Aip is the ip address of the primary name server for A.com, and Bip is the ip address for the primary dns server for B.com.

On host A
add these two slave zones for B.com in /etc/named.boot:

secondary B.com db.B
secondary 171.10.in-addr.arpa db.10.171

and /etc/resolv.conf should look like this:

domain A.com
search A.com B.com
nameserver Aip
nameserver Bip


On host B
add these two slave zones for A.com in /etc/named.boot:

secondary A.com db.A
secondary 15.10.in-addr.arpa db.10.15

and /etc/resolv.conf should look like this:

domain B.com
search B.com A.com
nameserver Bip
nameserver Aip


Now each side has full copies of each domain.


UNIX Engr
Advisor

Re: DNS Domains - How to get two domains to share data

Thanks to everyone who has responded.

Some issues I have discovered after testing the suggestions made:
If I implement the forwarders suggestion: add dns.B.com to the forwarders line in /etc/named.boot file on dns.A.com, then all external dns requests from users on A.com also get forwarded to dns.B.com and then out B.com's internet provider. Management does not like that idea.

If I implement the search option in the /etc/resolv.conf on dns.a.com,
example 1
domain a.com
search a.com b.com
nameserver dns.a.com
nameserver dns.b.com

The nameserver dns.b.com never gets a chance to resolve XX.B.com requests because dns.A.com doesn't time out on a XX.B.com request, it returns a "not found".

If I implement another way:
example 2
domain a.com
search a.com b.com
nameserver dns.b.com
nameserver dns.a.com

I experience the same issue as the forwarders option. IE every external request from dns.a.com goes to dns.b.com and out b.com's internet provider.

Third suggestion: Setting up each dns server as a secondary to the other is an option, yet the lack of anyone with DNS knowledge at B.com and the fact that B.com is running DNS on a platform which nobody at A.com can support, causes this to be the very last option.

Ideally I would like to resolve all XX.A.com requests from A.com users at dns.A.com and only send YY.b.com requests to dns.B.com and vis-a-versa.
I also want to have external requests from each companies users go to the internet via their companies own external DNS servers.
Any suggestions?
Jordan Bean
Honored Contributor
Solution

Re: DNS Domains - How to get two domains to share data

If neither side wants the other to have a complete slave zone copy, another option is to setup a stub zone on each side which contains only delegation information for selective forwarding.

For BIND4:
On dns.A.com, add this to /etc/named.boot:
stub B.com stub.B.com

On dns.B.com, add this to /etc/named.boot:
stub A.com stub.A.com

For BIND8:
On dns.A.com, add this to /etc/named.conf:
zone "B.com" { type stub; masters { ; }; file "stub.B.com"; };

On dns.B.com, add this to /etc/named.conf:
zone "A.com" { type stub; masters { ; }; file "stub.A.com"; };

I'm not sure what else you can do.