# Several DNS servers, only one queried?

## Kobboi

A colleague of mine is using the synergy client on his Gentoo system. He specifies the synergy server by its hostname, which needs resolving. His resolv.conf contains three DNS servers, one is reachable via an interface called TEST, the other two are reachable via an interface called LAB. His hosts.conf only contains a localhost entry and nsswitch.conf is the default as it was installed by glibc (2. :Cool: . Sniffing on TEST and LAB, it seems that only DNS requests are sent to the first DNS server in resolv.conf. It replies that it cannot resolve (normal). But that's it. Why aren't the other server queried or how can I make this happen?

----------

## gentoo_ram

Because that's not the way DNS is designed.  The resolver will stop once it gets a host "does not exist" response.  I'm not sure what behavior you're looking for exactly.  

If you want it to rotate around the different hosts in your resolv.conf you can add the line "options rotate" to the file.  That will make the resolver use different server each time.

But if you want the resolver to try each server until it gets a positive response, that's not going to happen.  It isn't designed to do that.  The only work around I can think is to run a name server on the box in question and load it up with all of the domain files you will need to do your testing.

----------

## Kobboi

Well, the LAB interface is connected to our office LAN and its DNS servers. The TEST interface is connected to a network device under test. The behavior he would like is to be able to have LAN hostnames resolved by the office DNS servers and others by the DUT, which is impossible, since it would require some knowledge about what hostnames are LAN hosts and which aren't.

Still, while looking at it, I was a bit surprised by the behavior. Your statement that "The resolver will stop once it gets a host "does not exist" response" is quite clear, thanks.

----------

## Princess Nell

Depending on the details of the specific situation, you may be able to solve this with dnsmasq. Among other things, it can be configured to listen on specific interfaces only, query all servers in parallel (and use the first reply), or send queries for particular domains to particular servers.

----------

## f4u5t

 *Kobboi wrote:*   

> The behavior he would like is to be able to have LAN hostnames resolved by the office DNS servers and others by the DUT, which is impossible, since it would require some knowledge about what hostnames are LAN hosts and which aren't.

 

It sounds like he is trying to do something on the sly. Why not add the records to the office DNS servers?

----------

