I have a local Linux server running dnsmasq for my LAN. It has been working without issues for the last several years. I keep the operating system and packages regularly updated. After yesterday's routine update, I am now getting errors from machines on the LAN when they attempt to resolve most local hostnames. I suspect I may have had a working configuration that was in some way flawed, and the update exposed my flaw; I'm not finding reports of this problem after the update, so I assume I have a mistake somewhere.
This is the error I am getting on most of the clients:
# ping myfileserver ping: myfileserver: Name or service not known
However, if I ping the address of myfileserver, it succeeds:
# ping 192.168.1.2 PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data. 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.325 ms 64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.239 ms
Here is resolv.conf on the clients:
# cat /etc/resolv.conf # Generated by NetworkManager search mylan nameserver 192.168.1.1
192.168.1.1 is the address of my dnsmasq server.
I may be overlooking something obvious, but drill shows that the client is getting a response from the dnsmasq server that contains the proper hostname and local IP address.
# drill myfileserver ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 40614 ;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;; myfileserver. IN A ;; ANSWER SECTION: myfileserver. 0 IN A 192.168.1.2 ;; AUTHORITY SECTION: ;; ADDITIONAL SECTION: ;; Query time: 0 msec ;; SERVER: 192.168.1.1 ;; WHEN: Wed Oct 24 00:12:18 2018 ;; MSG SIZE rcvd: 41
On the server, systemd shows the dnsmasq process is starting and running normally:
systemctl status dnsmasq.service dnsmasq.service - A lightweight DHCP and caching DNS server Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2018-10-24 00:08:13 EDT Docs: man:dnsmasq(8) Process: 28230 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS) Main PID: 28231 (dnsmasq) Tasks: 1 (limit: 4915) Memory: 1.4M CGroup: /system.slice/dnsmasq.service └─28231 /usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file
Here's the log output from dnsmasq starting up on the server. There are no errors.
Oct 23 01:50:48 mydnsmasqd systemd: Starting A lightweight DHCP and caching DNS server... Oct 23 01:50:48 mydnsmasqd dnsmasq: dnsmasq: syntax check OK. Oct 23 01:50:48 mydnsmasqd systemd: Started A lightweight DHCP and caching DNS server. Oct 23 01:50:48 mydnsmasqd dnsmasq: started, version 2.80 cachesize 5000 Oct 23 01:50:48 mydnsmasqd dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify du> Oct 23 01:50:48 mydnsmasqd dnsmasq: DBus support enabled: connected to system bus Oct 23 01:50:48 mydnsmasqd dnsmasq-dhcp: DHCP, IP range 192.168.10.100 -- 192.168.10.200, lease time 1d Oct 23 01:50:48 mydnsmasqd dnsmasq: using local addresses only for domain mylan Oct 23 01:50:48 mydnsmasqd dnsmasq: reading /etc/resolv-custom.conf Oct 23 01:50:48 mydnsmasqd dnsmasq: using local addresses only for domain mylan Oct 23 01:50:48 mydnsmasqd dnsmasq: using nameserver 126.96.36.199#53 Oct 23 01:50:48 mydnsmasqd dnsmasq: using nameserver 188.8.131.52#53 Oct 23 01:50:48 mydnsmasqd dnsmasq: read /etc/hosts - 72 addresses
During troubleshooting, I changed dnsmasq config, and restarted it. The log again shows no errors on starting and my various config changes had no impact on this issue. The dnsmasq configuration was not changed when this problem began. It is a relatively plain vanilla config, but during troubleshooting I simplified it to almost nothing. Here's what I have now (leaving out the interface binding part, which is clearly not relevant):
# grep -v '^#' /etc/dnsmasq.conf resolv-file=/etc/resolv-custom.conf dhcp-range=set:eth0,192.168.10.100, 192.168.10.200, 24h cache-size=5000 no-negcache conf-dir=/etc/dnsmasq.d,.bak # cat /etc/resolv-custom.conf search mylan domain mylan nameserver 184.108.40.206 nameserver 220.127.116.11
All machines are running Arch Linux, 4.18.10-arch1-1-ARCH Dnsmasq version 2.80