[Dnsmasq-discuss] Return an address if unable to resolve?
Simon Kelley
simon at thekelleys.org.uk
Thu Oct 18 20:52:32 BST 2007
Doug Moeller wrote:
> Does anyone know if there is a way to have dnsmasq return a predefined
> address if it was unable to resolve the name via the DNS servers defined
> in /etc/hosts and /etc/resolv.conf ?
>
> Basically I want it to return the address of the localhost if it's
> unable to resolve the name. For my application this would be the case
> when the box running dnsmasq is unable to get to the internet, but I'd
> like to redirect them to a local web page where I can explain why the
> Internet link might be down and offer some troubleshooting tips.
>
> Any hints or alternative suggestions would be greatly appreciated.
Doing this via the DNS is not a good idea, IMHO. Firstly, DNS is used
for more than the web: your mailer, NTP client etc etc may start to
behave in strange ways if the DNS system lies to them. Secondly there's
a chance that some systems will cache DNS results, so that even when you
go back on line, they will fail to work.
As an alternative, the proxy suggestion is good, or iptables rule which
just redirect connections to port 80.
Cheers,
Simon.
>
> Thanks
>
> -Doug
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
More information about the Dnsmasq-discuss
mailing list