dnsmasq: how to prevent upstream queries for hosts in /etc/hosts?
This question arises from my LQ thread "OOo: when no Internet: very slow to start and does not open file" in which Skaperen kindly helped me resolve the underlying problem as dnsmasq querying the upstream DNS servers to resolve the local machine, CW8, which is listed in /etc/hosts when OOo tries to resolve that name.
Research showed that this is default dnsmasq behaviour and that solution (as I understand it) is to:
EDIT: I just found a current LQ thread asking a very similar question, without a solution at the time of writing -- but solved by the OP within the hour.
My silly mistake in dnsmasq.conf, setting local=/localhost/ instead of local=/localdomain/ :redface: :doh:
Did you have to tamper with resolv.conf as well?
What I did is that I:
- added my local hostname to /etc/hosts with and without the .localdomain, e.g.:
184.108.40.206 hostname hostname.localdomain
- added this to my dnsmasq config:
But I still see in dnsmasq log that the query to "hostname" is forwarded to all the nameservers in my resolv.conf.
My resolv.conf contains 127.0.0.1 (dnsmasq runs here) and 2 other IPs given by the ISP provider.
|All times are GMT -5. The time now is 04:12 AM.|