[Dnsmasq-discuss] Return an address if unable to resolve?
Simon Kelley
simon at thekelleys.org.uk
Fri Oct 19 20:47:50 BST 2007
Doug Moeller wrote:
> Thanks for the replys. A couple of notes that might better define my
> problem.
>
> The clients that will be accessing this will be web only and
> unfortunately I don't have the ability to change their configuration.
>
> I have the redirect to port 80 in the system already, but that doesn't
> really solve my problem because the client will do a DNS lookup first
> and if that fails it won't try to connect to the web server at all.
> What I need is for the DNS lookup to return an address when the DNS
> lookup fails so that I can redirect them to port 80 on the localhost.
> Thanks
>
> -DOug
>
I understand: is your enviroment one where you know that the network
uplink is down, or is a DNS timeout the first sign of trouble?
This rather strange syntax:
address=/#/1.2.3.4
will _unconditionally_ return 1.2.3.4 for any A-record query which can't
be answered from /etc/hosts or DHCP.
If you have a script which run on net up/down, you could re-congfigure
dnsmasq using that (you'll need a restart, but that's very cheap): on
net down do
kill -TERM `cat /var/run/dnsmasq.pid`
dnsmasq --address=/#/1.2.3.4
on net up do
kill -TERM `cat /var/run/dnsmasq.pid`
dnsmasq
If, on the other hand you loose network connectivity silently, the
problem is rather more difficult.
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list