Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Multiple search domains and DNS?
New Posts  All Forums:Forum Nav:

Multiple search domains and DNS?

post #1 of 5
Thread Starter 
I have an environment where there are two different DNS servers. Each DNS server has resolution entries for one local domain as well as being able to provide WAN lookups. They do not have entries for nor forward to each other for their respective local domains and cannot be configured to do so. My situation is that I need to be able to transparently have my systems resolve both domains. I'm using Debian 8.5.0.

I cannot seem to get this to work.

For example, let's say I have two domains called domain1.local and domain2.local. Each domain has its own DNS server. Each domain has some systems that belong to that domain and all of those systems are on the same LAN. All systems can directly talk to each other as well as both DNS servers with no VLANs, routers, or firewalls between them. No two systems have the same hostname.

domain1.local:
192.168.0.10 = dns001.domain1.local
192.168.0.11 = pc001.domain1.local
192.168.0.12 = pc003.domain1.local
192.168.0.13 = pc005.domain1.local

domain2.local:
192.168.0.20 = dns002.domain2.local
192.168.0.21 = pc002.domain2.local
192.168.0.22 = pc004.domain2.local
192.168.0.23 = pc006.domain2.local

pc001, pc003, and pc005's resolv.conf looks like this:
search domain1.local domain2.local
nameserver 192.168.0.10
nameserver 192.168.0.20

pc001, pc003, and pc005's nsswitch.conf looks like this:
hosts files dns

As pc005, I would expect resolving "pc001" to work like this:
1) Check hosts (miss)
2) Query 192.168.0.10 for "pc001.domain1.local" (hit)

This does indeed work.

As pc005, I would expect resolving "pc002" to work like this:
1) Check hosts (miss)
2) Query 192.168.0.10 for "pc002.domain1.local" (miss)
3) Query 192.168.0.10 for "pc002.domain2.local" (miss)
4) Query 192.168.0.20 for "pc002.domain1.local" (miss)
5) Query 192.168.0.20 for "pc002.domain2.local" (hit)

This does not work. Instead, the machine cannot resolve the hostname. If I try nslookup, it searches for "pc002.domain1.local" on domain1's DNS server, fails with NXDOMAIN, and stops. I guess I do not understand what I should be doing differently. Does anyone have some insight?
post #2 of 5
I'm still trying to understand why you can't forward the DNS queries to the correct DNS server?
post #3 of 5
Thread Starter 
Quote:
Originally Posted by herkalurk View Post

I'm still trying to understand why you can't forward the DNS queries to the correct DNS server?

In the real world analogue to this scenario, the two domains are completely unrelated and have no logical reason to forward to each other. They aren't even on the same physical LAN but only bridged via VPN for the sake of management.
post #4 of 5
Even in that scenario you should be able to query the other DNS, or have the DNS servers linked. I managed an environment like that. We had an office with local DNS and then DNS in our datacenter, which we had a constant VPN connection to. Each with separate DNS that referred to each other.
post #5 of 5
Thread Starter 
I realize a DNS server could be configured to forward lookups, but solving this without doing so is sort of the point of this thread.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Multiple search domains and DNS?