[Dnsmasq-discuss] dnsmasq does not respond correctly on loopback(lo)
Frederick C. Damen
fred at damen.org
Fri Oct 15 05:25:51 BST 2010
It turns out that the name resolving software that runs previous to
talking to dnsmasq functions differently between the loop back interface
and the other interfaces when the domain and search options in the
/etc/resolv.conf are not specified. When specifying domain and search
options in /etc/resolv.conf, ping and dig give the desired results in
the aforementioned situations.
When specifying log-queries in the /etc/dnsmasq.conf file and restarting
dnsmasq the queries do not get logged to /var/log/messages, or anywhere
else. I suppose that the lower threshold for importance/severity is set
to high on syslog for the query syslog records to actually get written
to /var/log/messages. The log-facility option to log to a file is nice
since I am to lazy to try and figure out how to change the syslog threshold.
Thanks for the help,
On 10/14/2010 03:04 PM, richardvoigt at gmail.com wrote:
> On Wed, Oct 13, 2010 at 11:21 PM, Frederick C. Damen <fred at damen.org
> <mailto:fred at damen.org>> wrote:
> On 10/13/2010 04:16 PM, richardvoigt at gmail.com
> <mailto:richardvoigt at gmail.com> wrote:
>> On Wed, Oct 13, 2010 at 2:20 PM, <fred at damen.org
>> <mailto:fred at damen.org>> wrote:
>> I now see the option in the installed man page. There is no mention
>> of this option in my /etc/dnsmasq.conf file.
>> I do not suspect that this is the issue though: Each computer, the
>> server in question included, all have the same name(s), i.e.
>> interfaces are not named separately.
>> localise-queries couldn't care less about the interface names. It
>> tries to return an address in the same subnet as the address of the
>> interface where the query came in. So for queries coming in on
>> lo0, it would try to return addresses in the 127.x.x.x block.
> Assuming localise-queries is turned on: If I read the man page
> correctly, if I had the same DNS name associated with multiple ip
> addresses and one of these ip address is on the same subnet as the
> subnet of the interface that the request came in on then dnsmasq
> would return the address on this subnet, But if there are no single
> name to multiple ip address associations then return the ip address
> associate with the name even if the subnets do not match. This is the
> situation that I am having trouble with. DNS name printer1 is
> assigned one and only one address, 192.168.0.x. Thus dnsmasq should
> return this address no matter what subnet the request came in on.
> Besides the /etc/dnsmasq.conf does not enable localise-queries and
> the man page seems to suggest that this feature is disabled by
> Anyhow, how do I get printer1 to be resolved on SERVER without having
> to specify the interface by which to do the DNS name resolution?
> Initially, use either netstat or the dnsmasq logs (check after you
> query, not just the startup information) to verify that your request
> actually is going to dnsmasq and not some other dns daemon. The
> dnsmasq logs might also contain other clues as to what is happening.
>> Computers severed by dnsmasq both for DHCP and DNS work as
>> expected, i.e. the network printer 192.168.0.x, DNS name
>> 'printer1' gets its name through dnsmasq DHCP server on
>> 192.168.0.1, computer nick 192.168.0.y who has its DNS server set
>> in /etc/resolv.conf to 192.168.0.1 can ping printer1,
>> printer1.damen.org <http://printer1.damen.org>. The SERVER
>> 192.168.0.1(and external interface) with its first nameserver set
>> to 127.0.0.1 and following nameservers set to external name servers
>> in its /etc/resolv.conf can not ping printer1, printer1.damen.org
>> <http://printer1.damen.org>. On the SERVER if you direct the DNS
>> queries to go directly to 192.168.0.1 using dig's @ option the DNS
>> name printer1 can be resolved correctly. Going directly to DNS
>> server at 127.0.0.1 using dig does not resolve the DNS name.
>> Before I added 127.0.0.1 as the first nameserver in
>> /etc/resolv.conf the name resolution for DNS names external to my
>> LAN was slow and after adding it external name resolution when
>> fast, and the fact that 'dig @127.0.0.1 <http://127.0.0.1>
>> printer1' does not indicate inability to contact the DNS server, I
>> suspect that dnsmasq is acting as a DNS server on 127.0.0.1. But
>> why does dnsmasq not resolve the names in its DHCP configuration on
>> the 127.0.0.1 interface?
>> You might use netstat to find out for sure what process is
>> listening on 127.0.0.1:53 <http://127.0.0.1:53>
More information about the Dnsmasq-discuss