[Dnsmasq-discuss] Different answers from dnsmasq when querying locally vs. remotely

John Hanks john.hanks at colorado.edu
Tue Feb 21 16:46:59 GMT 2012


Hi,

I have two servers (ignoring my other hosts for the moment), mosquito
and necker, and each has interfaces in several VLANs. Dnsmasq is
running on both with a near-identical configuration, the only
difference is that mosquito hands out some dynamic ranges while necker
only gives addresses to known clients. (The setup is a crude attempt
to provide for failover.)

The hosts have the same name in all VLANs, dhcp-host entries are:

78:2b:cb:74:05:12,10.208.32.2,necker,infinite
78:2b:cb:74:05:12,10.209.16.2,necker,infinite
78:2b:cb:74:05:12,10.210.32.2,necker,infinite

78:2b:cb:73:e9:a6,10.208.32.1,mosquito,infinite
78:2b:cb:73:e9:a6,10.209.16.1,mosquito,infinite
78:2b:cb:73:e9:a6,10.210.32.1,mosquito,infinite

And there are host entries for the networks I connect to but don't
control dhcp for:

128.138.93.19 mosquito
128.138.93.20 necker

And I'm using localise-queries in my configuration.

This all works great when a remote host queries dnsmasq, for example
asking for necker's address from necker to dnsmasq running on
mosquito:

[root at necker ~]# host necker 10.210.32.1
Using domain server:
Name: 10.210.32.1
Address: 10.210.32.1#53
Aliases:

necker.biofrontiers.colorado.edu has address 10.210.32.2
[root at necker ~]# host necker 10.208.32.1
Using domain server:
Name: 10.208.32.1
Address: 10.208.32.1#53
Aliases:

necker.biofrontiers.colorado.edu has address 10.208.32.2
[root at necker ~]# host necker 10.209.16.1
Using domain server:
Name: 10.209.16.1
Address: 10.209.16.1#53
Aliases:

necker.biofrontiers.colorado.edu has address 10.209.16.2
[root at necker ~]# host necker 128.138.93.19
Using domain server:
Name: 128.138.93.19
Address: 128.138.93.19#53
Aliases:

necker.biofrontiers.colorado.edu has address 128.138.93.20

But if I ask the same queries from mosquito to dnsmasq on mosquito, I
get confusing answers for the networks in the class a 10.* VLANs

[root at mosquito dnsmasq]# host necker 10.210.32.1
Using domain server:
Name: 10.210.32.1
Address: 10.210.32.1#53
Aliases:

necker.biofrontiers.colorado.edu has address 10.210.32.2
necker.biofrontiers.colorado.edu has address 10.208.32.2
necker.biofrontiers.colorado.edu has address 10.209.16.2
[root at mosquito dnsmasq]# host necker 10.208.32.1
Using domain server:
Name: 10.208.32.1
Address: 10.208.32.1#53
Aliases:

necker.biofrontiers.colorado.edu has address 10.209.16.2
necker.biofrontiers.colorado.edu has address 10.210.32.2
necker.biofrontiers.colorado.edu has address 10.208.32.2
[root at mosquito dnsmasq]# host necker 10.209.16.1
Using domain server:
Name: 10.209.16.1
Address: 10.209.16.1#53
Aliases:

necker.biofrontiers.colorado.edu has address 10.208.32.2
necker.biofrontiers.colorado.edu has address 10.209.16.2
necker.biofrontiers.colorado.edu has address 10.210.32.2
[root at mosquito dnsmasq]# host necker 128.138.93.19
Using domain server:
Name: 128.138.93.19
Address: 128.138.93.19#53
Aliases:

necker.biofrontiers.colorado.edu has address 128.138.93.20
[root at mosquito dnsmasq]# host necker localhost
Using domain server:
Name: localhost
Address: ::1#53
Aliases:

necker.biofrontiers.colorado.edu has address 10.209.16.2
necker.biofrontiers.colorado.edu has address 10.210.32.2
necker.biofrontiers.colorado.edu has address 10.208.32.2
necker.biofrontiers.colorado.edu has address 128.138.93.20


All my VLAN interfaces have a netmask of 255.255.0.0, but it's as if
when mosquito asks mosquito, it seems to return all results for the
class A 10.*.*.* rather than for the /16 on the specific interfaces.
The interfaces look like:

vlan2052  Link encap:Ethernet  HWaddr 78:2B:CB:73:E9:A6
          inet addr:10.208.32.1  Bcast:10.208.255.255  Mask:255.255.0.0
          inet6 addr: fe80::7a2b:cbff:fe73:e9a6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:92242 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20030 errors:0 dropped:6 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:16903704 (16.1 MiB)  TX bytes:3916368 (3.7 MiB)

vlan2053  Link encap:Ethernet  HWaddr 78:2B:CB:73:E9:A6
          inet addr:10.209.16.1  Bcast:10.209.255.255  Mask:255.255.0.0
          inet6 addr: fe80::7a2b:cbff:fe73:e9a6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:470092 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9902 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:78570673 (74.9 MiB)  TX bytes:1149230 (1.0 MiB)

vlan2210  Link encap:Ethernet  HWaddr 78:2B:CB:73:E9:A6
          inet addr:10.210.32.1  Bcast:10.210.255.255  Mask:255.255.0.0
          inet6 addr: fe80::7a2b:cbff:fe73:e9a6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2547174 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1345153 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:366250682 (349.2 MiB)  TX bytes:13373885259 (12.4 GiB)


This would be something I could ignore except that I run a number of
services on mosquito and necker that need hostnames to resolve
correctly in order to check services on the proper interfaces. To
explain that more, I have both mosquito and necker use the IP of my
"management" VLAN in /etc/resolve.conf and have that interface open on
the rest of the hosts, but when the host lookup becomes effectively
round-robin across the addresses in the class A 10.*.*.*, my
connections/lookups only succeed 1/3 of the time (which degrades
further as I add VLANs...) Is there some additional configuration I
need to do to get dnsmasq to give the same answers locally that it
gives remotely?

Thanks,

jbh



More information about the Dnsmasq-discuss mailing list