Discussion:
[Dnsmasq-discuss] dns/resolv.conf shoud follow DNS server as learned via DHCP
Rene Stoutjesdijk
2017-03-04 09:41:34 UTC
Permalink
i did setup the dnsmasq to be the dns server/resolver for my clients.
this works fine when i say that the resolver (at my dnsmasq server) is
pointing towards 8.8.8.8

However, my uplink router and ISP could change, so what i'm looking for now
is that the resolver doesn't point anymore to the 8.8.8.8 but follows the
DNS server which i do get provided automatically by the ISP router (as the
interface between the local host and the router is DHCP derived).
( i know it could stil work with the 8.8.8.8 but i want to explore this
alternative)

Can this be achieved within dnsmasq? and if yes how.

thx in advance for your response
Dan Williams
2017-03-05 17:43:14 UTC
Permalink
Post by Rene Stoutjesdijk
i did setup the dnsmasq to be the dns server/resolver for my clients.
this works fine when i say that the resolver (at my dnsmasq server) is
pointing towards 8.8.8.8
However, my uplink router and ISP could change, so what i'm looking for now
is that the resolver doesn't point anymore to the 8.8.8.8 but follows the
DNS server which i do get provided automatically by the ISP router (as the
interface between the local host and the router is DHCP derived).
( i know it could stil work with the 8.8.8.8 but i want to explore this
alternative)
Can this be achieved within dnsmasq? and if yes how.
dnsmasq should be doing this already, unless you've given it the --no-
poll option. 'man dnsmasq' says "Unless --no-poll is used, dnsmasq
checks the modification time of /etc/resolv.conf (or equivalent if --
resolv-file is used) and re-reads it if it changes."

But to debug a bit further, when you notice that dnsmasq isn't using
the same nameserver as in resolv.conf, try 'killall -HUP dnsmasq' and
see if that helps things. dnsmasq will reread resolv.conf when sent
the HUP signal.

Dan

Loading...