Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As is common with home routers, my router, an ASUS RT-N66U, is configured to act as a caching nameserver for my LAN. It looks like the router uses dnsmasq for name service. The router also offers DHCP service, and allows reserving IP addresses for particular MAC addresses -- local-only, RFC 1918 addresses of course. Conveniently, this router allows name resolution for those reserved IP addresses. So, at the command line, "ping mykids-pc" will correctly resolve the local IP address for that device and successfully ping it.

On my Linux desktop, I have BIND configured both as a caching nameserver, and as an authoritative server for virtual machines I run on my Linux desktop. So, "ping centos.posix.test" will resolve the IP and successfully ping it.

The problem is, I can't find a way to do both conveniently at the same time. I haven't figured out how to get BIND on my desktop to use the router as a forwarder for RFC 1918 addresses, or how to configure dnsmasq on my router to use my desktop as a forwarder.

Is there a way to do this?

share|improve this question
You can't configure a DNS server to forward requests for specific addresses, since it won't know the address until after the name gets resolved... You can, however, configure Bind9 to forward requests for specific domains, using zone "foo" { type forward; forwarders ... }; is one possible way. – grawity Aug 24 '12 at 0:33
That pretty much gets at the central problem; given my current setup, I can't actually do both things at once. – bgvaughan Aug 28 '12 at 11:22
up vote 2 down vote accepted

I believe you could put the DHCP allocated computers into a subdomain and use DNS delegation to hand-off queries to the router whilst still maintaining ISP nameservers as forwarders.

So your Linux desktop would be authoritative for, containing etc. The router would be configured to be authoritative for containing etc.

You just need to add the appropriate delegation records.

share|improve this answer
A subdomain and delegation is not necessary – in bind9, type forward zones exist and can be used even for TLDs. – grawity Aug 24 '12 at 0:40
This seems like the right approach in general, though I'd need BIND on my router, not just dnsmasq. – bgvaughan Aug 28 '12 at 11:21

I have named running on a server that resolves names for a local TLD and forwards other queries to Google's public DNS.

This is what my /etc/bind/named.conf.options looks like:

options {
        forward only;
        forwarders {

To make it use your router as a forwarder, delete one of the forwarders stanzas and put your router's IP address for the remaining one.

share|improve this answer
Unfortunately, the LAN router has an RFC 1918 address,, and forwarding to an RFC 1918 address doesn't seem to work. – bgvaughan Aug 23 '12 at 22:07
I don't see why it being an RFC 1918 address would change anything. But there could be something going on I don't know about. I learn more about BIND every time I have to reconfigure it. – LawrenceC Aug 23 '12 at 23:03
@bgvaughan I have successfully configured several instances of bind9 to use my own router at a RFC 1918 address as a forwarder, both for all requests and for specific zones. There is absolutely nothing special in that. – grawity Aug 24 '12 at 0:37
I misstated. It seems to use as a forwarder without trouble in general. However, after setting that up, 'dig mykids-pc' gets an NXDOMAIN response even though it lists '' as the name server, whereas 'dig mykids-pc @' gets the expected result. – bgvaughan Aug 24 '12 at 0:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .