Server Fault is a question and answer site for system and network administrators. 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

I run BIND locally on my OS X machine, to enable wildcard Apache vhosts, which requires setting the DNS server for all network interfaces to

This works great, but means when I am on a network which uses an internal DNS server to route special (i.e. .companyname) URLs to a server on the network, the lookup fails.

I tried adding both and the DHCP provided DNS server, but this doesn't work either.

Is there a way to make BIND use the DHCP DNS server for requests it cannot resolve locally?

share|improve this question
up vote 1 down vote accepted

Bind was not designed for this use-case. It was designed to be run on a server where the same sysadmin configures it and the DHCP server. It was not designed to move.

You could hack together a script to change the forwarders in Bind every time your DHCP lease was refreshed but I couldn't recommend this. You will run into caching issues where your .company domains are cached as NXDOMAIN when they shouldn't be or cached as a real IPs when they shouldn't be.

There may be a specialised caching/resolving mame server that has the functionality you're after built in but Bind isn't it.

share|improve this answer

You can configure forwarders to which BIND will forward all requests that it cannot resolve by itself. However, BIND is always able to resolve any name for a domain for which it is authoritative. If you configure a wildcard record *, you can't make BIND resolve from some other DNS server. You would need to configure those records in the zone hosted by your BIND instance.

share|improve this answer
The local instance of BIND is only authoritative for .localhost domains, so that won't be a problem - it's .companyname domains that aren't working. I have done a bit of research on forwarders, but don't know how to set it up to use the DHCP DNS server. – user81077 Sep 20 '12 at 6:41
You can't configure BIND to use forwarders from DHCP. What might work is using a script to discover the DNS servers, change the forwarders in your named.conf and restart BIND. – Ansgar Wiechers Sep 20 '12 at 8:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.