[Dnsmasq-discuss] Return an address if unable to resolve?

Doug Moeller dmoeller at pobox.com
Sat Oct 20 18:53:21 BST 2007


Brilliant!  That actually works perfectly,   but I ran into an 
unexpected issue.  

It appears that the the browsers actually keep their own DNS cache 
(separate from the OS DNS cache) that doesn't pay attention to the TTL 
setting, so when the uplink comes back up, the browsers still go to the 
localhost.    It seems that Firefox has a default of 60 seconds and IE 
is 30 minutes (which is way too long).  And it seems that this is a 
local browser configuration setting and not something I can prevent from 
happening in the html. (I can prevent the content from caching in the 
html,  but not the DNS entry).

Grrrr.  So close.  I'm stumped on how to work around this one.

Thanks again.

-Doug



Simon Kelley wrote:
> 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