default DNS response for unknown hosts?

Kevin Darcy kcd at
Tue Jan 14 22:56:04 UTC 2003

Alexander Widmann wrote:

> Hi folks,
> I have a private lan connected to the internet via a linux router
> (dialup ISDN, iptables). Within the lan, there's a couple of windoze
> clients as well as another linux box running apache and bind (caching
> only).
> With this setup, I'm trying to do the following:
> whenever the router is offline, all http requests from the lan (win
> clients) should get redirected to the linux box running apache. In
> case the ISDN connection is up, the requests should get send out to
> the internet.
> I already tried to redirect all (http) requests to the outside world
> to my apache box using iptables whenever the ppp link is down - works
> fine as long as the requested url can be resolved from bind's cache
> (browser gets an ip address back from the DNS query, tries to contact
> the remote server and gets redirected to the local apache). In case
> the bind daemon cannot answer the DNS query from its cache this
> doesn't work (naturally, since bind cannot forward the request, hence
> the browser doesn't get an ip address back).
> Question: is there a way to teach the bind daemon to return some sort
> of a default ip address (address of the apache box) for all DNS
> requests which would normally have to be forwarded to other DNS
> servers on the internet?

No, not reasonably. I suppose you could kludge together something using
a remote forwarder and "forward first" mode (i.e. try to forward by
default, but if that doesn't work, fall back to iterative forwarding,
where you'd have your own private root zone with a wildcard in it), but
that would misfire occasionally (whenever a transient network problem
caused the failover) and even when it worked properly, would introduce
delays for every query when in "disconnected" mode. It would be pretty

> Any other ideas how to solve the problem?

After thinking this through several times over the years, the only idea
that comes to mind is something that automatically reconfigures named
whenever the Internet link comes up or goes down. I've never actually
implemented such a thing however...

- Kevin

More information about the bind-users mailing list