Our office subnet is

I have a gateway ( that is forwarding DNS requests to a server running DNSmasq ( I have an IPsec tunnel to our Parent Company's network (

In the resolv.conf on, I've specified two (2) nameservers, (Google DNS) and (Parent Company DNS).

My issue is that also services another
This means that sometimes reverse DNS lookups return hostnames on the foreign instead of our internal network. We can see this by using tools like dig or IP scanners. Also, sometimes our OS X bash prompts show the wrong hostname.

So my proposed solution would be to direct all reverse DNS lookups for addresses within to's internal lookup table, but I don't know how to go about this, or if this is the right solution.

I should note that I have no control over

EDIT: I have found another possible solution. I'll test it out before adding it as an answer. Assuming uses DNSmasq, I can add specify the --bogus-priv option. Since is also our DHCP server, it should return "no such domain" for any reverse DNS queries of hosts within that are not within the DHCP leases file.


Try this: set up a DNS server that will serve revs properly (and anything else you want), but will forward the rest to I assume you can change the DNS from to on client machines. If you can't do that, grab the network traffic to on a router and redirect it (except of course). This should work transparently.

  • > that will serve revs properly – Josh Cooley May 6 '15 at 20:31
  • "that will serve revs properly" Revs? The clients are sending all DNS traffic to which then forwards to DNS lookups should not be going directly to from the client machines (unless someone has specified it on their machine). I'm not sure I understand what you're suggesting. If I were to redirect DNS traffic destined to, to instead go to, it might still send it back to since it is a specified resolver. – Josh Cooley May 6 '15 at 20:38
  • Revs - reverse DNS queries. Ok, so now you are forwarding the traffic on the level of IP redirect, is that correct? – Konrad Gajewski May 6 '15 at 21:14

Using the dnsmasq --bogus-priv option worked for me. Since is also our DHCP server, it returns "no such domain" for any reverse DNS queries of hosts within that are not within the DHCP leases file.

From dnsmasq(8):

-b, --bogus-priv Bogus private reverse lookups. All reverse lookups for private IP ranges (ie 192.168.x.x, etc) which are not found in /etc/hosts or the DHCP leases file are answered with "no such domain" rather than being forwarded upstream.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.