Skip to content

Installation of dnsmasq breaks DNS-resolution #1446

@theCalcaholic

Description

@theCalcaholic

I'm currently trying to use the curl installer to install NCP on a fesh debian 11 server. However, the installer consistently fails after installing the dnsmasq app, because the system (namely apt) can't resolve any domains anymore.

I've dug into the issue and don't yet understand completely what's causing it, but I'm 90% sure dnsmasq only breaks in conjunction with something the installer did before and I also found a workaround. So here are my findings:

  1. Installing dnsmasq on the fresh debian system works without issues. So the problem must be caused by some config change or package installed by the installer.
  2. The dnsmasq service fails with a very generic error message which didn't help me to get to it's cause:
Job for dnsmasq.service failed because a timeout was exceeded.
See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
invoke-rc.d: initscript dnsmasq, action "start" failed.
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
    Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
    Active: failed (Result: timeout) since Fri 2022-03-25 12:27:44 UTC; 27ms ago
    Process: 27746 ExecStartPre=/etc/init.d/dnsmasq checkconfig (code=exited, status=0/SUCCESS)
    Process: 27750 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
    Process: 27755 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=killed, signal=TERM)
  Main PID: 27754 (code=exited, status=0/SUCCESS)
    CPU: 82ms

Mar 25 12:26:14 debian-11 dnsmasq[27754]: reading /run/dnsmasq/resolv.conf
Mar 25 12:26:14 debian-11 dnsmasq[27754]: using nameserver 2a01:4ff:ff00::add:2#53
Mar 25 12:26:14 debian-11 dnsmasq[27754]: using nameserver 2a01:4ff:ff00::add:1#53
Mar 25 12:26:14 debian-11 dnsmasq[27754]: using nameserver 185.12.64.1#53
Mar 25 12:26:14 debian-11 dnsmasq[27754]: using nameserver 185.12.64.2#53
Mar 25 12:27:44 debian-11 systemd[1]: dnsmasq.service: start-post operation timed out. Terminating.
Mar 25 12:27:44 debian-11 dnsmasq[27754]: exiting on receipt of SIGTERM
Mar 25 12:27:44 debian-11 systemd[1]: dnsmasq.service: Control process exited, code=killed, status=15/TERM
Mar 25 12:27:44 debian-11 systemd[1]: dnsmasq.service: Failed with result 'timeout'.
Mar 25 12:27:44 debian-11 systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
  1. This error can be avoided, by stopping systemd-resolve after installing dnsmasq and then starting dnsmasq (it can be stopped afterwards and DNS resolution will still work). I've implemented this workaround and am going to create a PR where it can be discussed further. However, the workaround implies, that there is some sort of conflict between systemd-resolve and dnsmasq (maybe listening on the same port? Allthough I couldn't verify that).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions