Merge #106 Add steps to dnsmasq setup guide to avoid conflicts with systemd-resolved

This commit is contained in:
Paul Maconi 2025-08-16 14:42:16 +00:00
commit 4691d6806d

View file

@ -184,17 +184,34 @@ Allow ports for DHCP and DNS (53) service on the public interface.
[…]# firewall-cmd --list-all
----
6. Restart NetworkManager to start dnsmasq
6. Disabling the systemd-resolved stub resolver
+
Inhibit the stub resolver and remove the symlink /etc/resolv.conf so that Network Manager will generate a new resolv.conf directing queries to dnsmasq. For more info, see the man page for "systemd-resolved" under the heading "/ETC/RESOLV.CONF".
+
[source,]
----
[…]# find /etc/resolv.conf -printf '%p -> %l\n'
/etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
[…]# rm -f /etc/resolv.conf
[…]# mkdir -p /etc/systemd/resolved.conf.d
[…]# echo -e "[Resolve]\nDNSStubListener=no" > /etc/systemd/resolved.conf.d/no-stub-listener.conf
----
7. Restart systemd-resolved and restart NetworkManager to start dnsmasq
+
The first time we restart systemd-resolved, it will no longer be running the stub resolver. The second time, we are reloading the configuration to prompt systemd-resolved to re-assess the /etc/resolv.conf generated by NetworkManager, but systemd-resolved does not support the "reload" unit command.
+
[source,]
----
[…]# systemctl restart systemd-resolved
[…]# systemctl restart NetworkManager
[…]# systemctl restart systemd-resolved
----
+
NetworkManager adjusts now the nameserver entries in /etc/resolv. They are replaced by 127.0.0.1 and processed via dnsmasq.
7. Test the installation
a. The dnsmasp internal self test
8. Test the installation
a. The dnsmasq internal self test
+
[source,]
----