[Dnsmasq-discuss] Where does dnsmasq get upstream DNS servers by default?

Uwe Schindler uwe at thetaphi.de
Sun May 29 15:29:41 UTC 2022


Hi,

/etc/resolv.conf may have this header, because at some point resolvconf 
was installed on your system. If resolvconf is (or was) installed, the 
main /etc/resolv.conf file is a symlink to some autogenerated file 
(/run/resolvconf/resolv.conf). This autogenerated file is created 
because resolvconf wants all local apps (except) dnsmasq to use dnsmasq 
as DNS server. It is NOT used as upstream server by dnsmasq, it is for 
downstream programs on local machine (like ssh, mail server,...). Plain 
simple?

So in short, your /etc/resolv.conf is correct. If you dont have 
resolvconf package installed (check with 'dpkg -l | grep resolv') it is 
a relic, but the contents are correct.

The upstream resolver used by dnsmasq is also maintained by resolvconf 
(if enabled) and passed via command line. It is also in the 
/run/resolvconf folder. If you don't have resolvconf pkg installed, you 
HAVE TO add your own "resolv-file=<filename>" or "server=ip" to dnsmasq 
config file, otherwise it won't work. There's no default on Ubuntu.

Uwe

Am 29.05.2022 um 16:18 schrieb Chris Green:
> With the default /etc/default/dnsmasq file on Ubuntu it says:-
>
>      # If the resolvconf package is installed, dnsmasq will use its output
>      # rather than the contents of /etc/resolv.conf to find upstream
>      # nameservers. Uncommenting this line inhibits this behaviour.
>      # Note that including a "resolv-file=<filename>" line in
>      # /etc/dnsmasq.conf is not enough to override resolvconf if it is
>      # installed: the line below must be uncommented.
>      #IGNORE_RESOLVCONF=yes
>
> I'm pretty sure I don't have resolvconf (or openresolv) so, in this
> case how does dnsmasq find the upstream servers.  /etc/resolv.conf is :-
>
>      # Generated by resolvconf
>      nameserver 127.0.0.1
>      search zbmc.eu
>      
> Which is a bit odd since I don't have resolvconf.
>
> The system works OK, DNS works, but I'd like to know how.
>
>
-- 
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: uwe at thetaphi.de




More information about the Dnsmasq-discuss mailing list