Dnsmasq issue for LAN host name resolution

So, I’ve followed guides on how to get Dnsmasq configured for local DNS and DHCP on a RPi, I’m running Ubuntu Mate 16.04 on my RPi. I believe I have something configured incorrectly because none of my clients on my LAN can resolve host names of each other. The host name of my Dnsmasq DNS and DHCP server is pimate. Here is the config:

domain-needed
bogus-priv
domain=2019.local
expand-hosts
local=/2019.local/
#interface=enxb827eb678f55
listen-address=127.0.0.1
#listen-address=192.168.15.12
bind-interfaces
dhcp-range=lan, 192.168.15.100, 192.168.15.160, 12h
dhcp-option=lan,3, 192.168.15.1
dhcp-option=lan,6, 192.168.15.12

dhcp-host=ac:9e:17:b4:f1:e3,192.168.15.10

server=208.67.222.222
server=208.67.220.220

log-facility=/var/log/dnsmasq.log
log-async

Here is the /etc/hosts file on my Dnsmasq DNS/DHCP server:

192.168.15.12	pimate
192.168.15.12	pimate.2019.local
127.0.0.1	localhost
127.0.1.1	pimate
192.168.15.1	router
192.168.15.2	merakisw
192.168.15.3	roboteye1
192.168.15.4	roboteye2
192.168.15.5	roboteye3
192.168.15.6	re200
192.168.15.7	merakiap
192.168.15.8	bufnas
192.168.15.9	xbox
192.168.15.10	edmate1604
192.168.15.30	robotmedia
192.168.15.98	brothers
192.168.15.99	hp

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Here what I am seeing when I run 'netstat -aunp:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:67              0.0.0.0:*                           9200/dnsmasq    
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1227/dnsmasq    
udp        0      0 0.0.0.0:631             0.0.0.0:*                           1020/cups-browsed
udp        0      0 192.168.15.12:123       0.0.0.0:*                           1692/ntpd       
udp        0      0 127.0.0.1:123           0.0.0.0:*                           1692/ntpd       
udp        0      0 0.0.0.0:123             0.0.0.0:*                           1692/ntpd       
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           975/avahi-daemon: r
udp        0      0 127.0.0.1:36831         127.0.1.1:53            ESTABLISHED 2319/synergyc   
udp        0      0 0.0.0.0:38374           0.0.0.0:*                           975/avahi-daemon: r
udp        0      0 127.0.0.1:53            0.0.0.0:*                           9200/dnsmasq    
udp        0      0 127.0.1.1:53            0.0.0.0:*                           1227/dnsmasq    
udp        0      0 192.168.15.12:53        0.0.0.0:*                           1227/dnsmasq    
udp6       0      0 fe80::d269:be77:3cb:123 :::*                                1692/ntpd       
udp6       0      0 ::1:123                 :::*                                1692/ntpd       
udp6       0      0 :::123                  :::*                                1692/ntpd       
udp6       0      0 :::5353                 :::*                                975/avahi-daemon: r
udp6       0      0 :::34564                :::*                                975/avahi-daemon: r

Looking at the /var/log/dnsmasq.log file I see this:

Aug  7 15:38:59 dnsmasq-dhcp[8753]: DHCP, IP range 192.168.15.100 -- 192.168.15.160, lease time 1h
Aug  7 15:38:59 dnsmasq[8753]: using nameserver 208.67.220.220#53
Aug  7 15:38:59 dnsmasq[8753]: using nameserver 208.67.222.222#53
Aug  7 15:38:59 dnsmasq[8753]: using local addresses only for domain 2019.local
Aug  7 15:38:59 dnsmasq[8753]: no servers found in /var/run/dnsmasq/resolv.conf, will retry
Aug  7 15:38:59 dnsmasq[8753]: read /etc/hosts - 21 addresses
Aug  7 15:39:40 dnsmasq[8753]: reading /var/run/dnsmasq/resolv.conf
Aug  7 15:39:40 dnsmasq[8753]: using nameserver 208.67.220.220#53
Aug  7 15:39:40 dnsmasq[8753]: using nameserver 208.67.222.222#53
Aug  7 15:39:40 dnsmasq[8753]: using local addresses only for domain 2019.local
Aug  7 15:39:40 dnsmasq[8753]: ignoring nameserver 127.0.0.1 - local interface
Aug  7 15:39:41 dnsmasq[8753]: no servers found in /var/run/dnsmasq/resolv.conf, will retry
Aug  7 15:42:39 dnsmasq[8753]: exiting on receipt of SIGTERM
Aug  7 15:42:40 dnsmasq[9200]: started, version 2.75 cachesize 150
Aug  7 15:42:40 dnsmasq[9200]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Aug  7 15:42:40 dnsmasq-dhcp[9200]: DHCP, IP range 192.168.15.100 -- 192.168.15.160, lease time 1h
Aug  7 15:42:40 dnsmasq[9200]: using nameserver 208.67.220.220#53
Aug  7 15:42:40 dnsmasq[9200]: using nameserver 208.67.222.222#53
Aug  7 15:42:40 dnsmasq[9200]: using local addresses only for domain 2019.local
Aug  7 15:42:40 dnsmasq[9200]: no servers found in /var/run/dnsmasq/resolv.conf, will retry
Aug  7 15:42:40 dnsmasq[9200]: read /etc/hosts - 22 addresses

While researching some one mentioned on a thread that Network Manager can cause a conflict and comment out the dnsmasq entry in /etc/NetworkManager/NetworkManager.conf, I have done that:

[main]
plugins=ifupdown,keyfile,ofono
#dns=dnsmasq

[ifupdown]
managed=false

One thing I find interesting in the /var/log/dnsmasq.log is this:

Aug 7 15:42:40 dnsmasq[9200]: no servers found in /var/run/dnsmasq/resolv.conf, will retry

My /var/run/dnsmasq/resolv.conf is empty.

This is my /etc/resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1

Thoughts? Any idea why no one can resolve host names on my LAN? I can’t even resolve the DNS server host name on all my clients.

Here is something interesting to add to the puzzle, it’s intermittent.

DNS/DHCP Server:

pimate - 192.168.15.12

Clients:

edmate1604 - 192.168.15.10 (statically assigned by Dnsmasq)
kalivm - 192.168.15.148 (DHCP client)
fed22vm - 192.168.15.105 (DHCP client)

edmate can ping fed22vm and kalivm but can’t ping pimate:

[ ed@edmate1604: ~ ]$ ping kalivm
PING kalivm (192.168.15.148) 56(84) bytes of data.
64 bytes from kalivm.2019.local (192.168.15.148): icmp_seq=1 ttl=64 time=0.254 ms
64 bytes from kalivm.2019.local (192.168.15.148): icmp_seq=2 ttl=64 time=0.119 ms
64 bytes from kalivm.2019.local (192.168.15.148): icmp_seq=3 ttl=64 time=0.147 ms
^C
--- kalivm ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.119/0.173/0.254/0.059 ms

[ ed@edmate1604: ~ ]$ ping fed22vm
PING fed22vm (192.168.15.105) 56(84) bytes of data.
64 bytes from fed22vm.2019.local (192.168.15.105): icmp_seq=1 ttl=64 time=0.199 ms
64 bytes from fed22vm.2019.local (192.168.15.105): icmp_seq=2 ttl=64 time=0.149 ms
64 bytes from fed22vm.2019.local (192.168.15.105): icmp_seq=3 ttl=64 time=0.117 ms
^C
--- fed22vm ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.117/0.155/0.199/0.033 ms

[ ed@edmate1604: ~ ]$ ping pimate
ping: unknown host pimate

kalivm can ping fed22vm but can’t ping edmate1605 and pimate:

root@kalivm:~# ping fed22vm
PING fed22vm.2019.local (192.168.15.105) 56(84) bytes of data.
64 bytes from fed22vm.2019.local (192.168.15.105): icmp_seq=1 ttl=64 time=0.218 ms
64 bytes from fed22vm.2019.local (192.168.15.105): icmp_seq=2 ttl=64 time=0.215 ms
^C
--- fed22vm.2019.local ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.215/0.216/0.218/0.014 ms
root@kalivm:~# ping edmate1604
ping: unknown host edmate1604
root@kalivm:~# ping pimate
ping: unknown host pimate

fed22vm can ping kalivm but can’t ping edmate1604 and pimate:

[ ed@fed22vm: ~ ]$ ping kalivm
PING kalivm.2019.local (192.168.15.148) 56(84) bytes of data.
64 bytes from kalivm.2019.local (192.168.15.148): icmp_seq=1 ttl=64 time=0.178 ms
64 bytes from kalivm.2019.local (192.168.15.148): icmp_seq=2 ttl=64 time=0.158 ms
64 bytes from kalivm.2019.local (192.168.15.148): icmp_seq=3 ttl=64 time=0.203 ms
^C
--- kalivm.2019.local ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.158/0.179/0.203/0.024 ms
[ ed@fed22vm: ~ ]$ ping edmate1604
ping: unknown host edmate1604
[ ed@fed22vm: ~ ]$ ping pimate
ping: unknown host pimate

Are kalivm and fed22vm virtual machines running on edmate1604?

Yes. However, this intermittent behavior is not exclusive to virtual machines. I have a physical machine that can ping a virtual machine, a physical machine but can’t ping two other physical machines:

[ ed@edkor24: ~ ]$ ping pimate
ping: pimate: Name or service not known
[ ed@edkor24: ~ ]$ ping edmate1604
ping: edmate1604: Name or service not known
[ ed@edkor24: ~ ]$ ping kalivm
PING kalivm.2019.local (192.168.15.148) 56(84) bytes of data.
64 bytes from kalivm.2019.local (192.168.15.148): icmp_seq=1 ttl=64 time=1.74 ms
64 bytes from kalivm.2019.local (192.168.15.148): icmp_seq=2 ttl=64 time=1.56 ms
^C
— kalivm.2019.local ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.565/1.652/1.740/0.096 ms
[ ed@edkor24: ~ ]$ ping chelby-pc
PING chelby-pc.2019.local (192.168.15.110) 56(84) bytes of data.
64 bytes from chelby-PC.2019.local (192.168.15.110): icmp_seq=1 ttl=128 time=20.5 ms
64 bytes from chelby-PC.2019.local (192.168.15.110): icmp_seq=2 ttl=128 time=17.1 ms
64 bytes from chelby-PC.2019.local (192.168.15.110): icmp_seq=3 ttl=128 time=15.0 ms
^C
— chelby-pc.2019.local ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 15.010/17.558/20.500/2.263 ms

So, I’m no expert, never had to setup Dnsmasq myself, but something’s bothering me in your setup.

I think you have a subnet collision.

As in, You have two subnets on edmate1604 and they share the same mask:

One Net between pimate and edmate1604, 192.168.15.0/24
One Net between edmate and the VMs, also 192.168.15.0/24

I had that happen the other day because I was using my phone as a hotspot for a machine, it was routing for the 10.42.0.0/24 net, but the machine was sharing connection by cable to another net also on 10.42.0.0/24, and it produced weird behavior: the setup was working for a very brief moment and all of a sudden pings were no longer able to get out (I suspect because some traffic had passed in the other net)

It think it’s a network/routing problem before being a name resolution problem.

@ouroumov that is an interesting thought. Maybe it’s the DHCP scope that is not working properly since I did not specify the /24? I may go back into the dnsmasq.conf file and specify the /24 in the scope to see if that makes a difference.
My thought about the Dnsmasq configuration is that looking at the netstat dump on the Dnsmaq/DNS server shows that I have multiple IP addresses for Dnsmasq:

udp 0 0 127.0.0.1:53 0.0.0.0:* 9200/dnsmasq
udp 0 0 127.0.1.1:53 0.0.0.0:* 1227/dnsmasq
udp 0 0 192.168.15.12:53 0.0.0.0:* 1227/dnsmasq

I keep thinking there is a conflict there somewhere, somehow, I just can’t put my finger on it.

I did some research and even looked at the dnsmasq.conf file template section and the CIDR or netmask isn’t really required.
Is it possible I need to remove 127.0.0.1 and 127.0.1.1 from my /etc/hosts file?

So, today, I decided to poke around some more on my Dnsmasq DNS server and found this:

I didn't do this in the GUI and I am not sure how this happened. Could this be the Network Manager conflict others have mentioned as I stated earlier?