[Dnsmasq-discuss] How to resolve resolv.conf problems?
Chris Green
cl at isbd.net
Sat Dec 4 14:55:08 UTC 2021
I know this is *slightly* away from dnsmasq but it's somewhat
entangled with it and there are knowledgeable people here.
I'm trying to not use systemd.resolved and use dnsmasq instead on both
Raspberry Pi systems and xubuntu.
However the configuration still depends on resolvconf working
correctly and I'm not convinced that it does, and I'm not seeing the
same results on Pi and xubuntu.
On my Pi systems dnsmasq gets run as follows:-
dnsmasq 612 1 0 Dec02 ? 00:00:00 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anchor=.,20326,8,2,e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
So it says it's using /run/dnsmasq/resolv.conf which is:-
# Generated by resolvconf
nameserver 192.168.1.2
However /etc/resolv.conf is:-
domain zbmc.eu
nameserver 127.0.0.1
Will dnsmasq be providing cacheing in this case as 127.0.0.1 isn't in
the resolv.conf file it seems to be using? In addition, how can I get
resolvconf to add both 127.0.0.1 and the upstream server at
192.168.1.2 to the resolv.conf file it provides for dnsmasq?
On an xubuntu system dnsmasq is running as:-
dnsmasq 2726 1 0 14:28 ? 00:00:00 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anchor=.,20326,8,2,e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
However in this case /run/dnsmasq/resolv.conf doesn't exist! How is
this supposed to work? Does dnsmasq use /etc/resolv.conf if the file
given by the -r option doesn't exist?
As a final question, if one wants dnsmasq to do local cacheing do you
put 'nameserver 127.0.0.1' in the resolv.conf file and then provide
the upstream dns server elsewhere in the configuration?
--
Chris Green
More information about the Dnsmasq-discuss
mailing list