[Dnsmasq-discuss] What's the "right" way to specify upstream servers?

Chris Green cl at isbd.net
Sat Sep 4 16:52:41 UTC 2021

On Sat, Sep 04, 2021 at 04:33:10PM +0200, Matus UHLAR - fantomas via Dnsmasq-discuss wrote:
> On 03.09.21 17:13, Chris Green wrote:
> > I know there probably isn't a "right" way to do this but, while I've
> > been trying to sort out how to make my dns/dhcp more resilient, I have
> > looked at my existing dnsmasq running on a Pi and it looks a bit odd
> > to me.
> > 
> > It's a pretty standard, off the shelf Raspberry Pi installation using
> > the Lite version as it's headless.  The dnsmasq.conf file has been
> > changed quite a lot over the years though and I wonder if it's still
> > optimal.
> > 
> > The upstream servers *seem* to be specified in /etc/dhcpcd.conf as
> > follows:-
> > 
> >    # Example static IP configuration:
> >    interface eth0
> >    static ip_address=
> >    #static ip6_address=fd51:42f8:caae:d92e::ff/64
> >    static routers=
> >    static domain_name_servers=
> this is dhcp client configuration, not dhcp server.
> iiuc it tells dhcp client not to use IP address, default route nor servers
> that DHCP server provided.
This *is* the DHCP server for my LAN so these are the upstream DNS
servers it gives to its clients.

> I really wonder why you run dhcp client in this case.
> > /etc/resolv.conf is:-
> > 
> >    # Generated by resolvconf
> >    nameserver
> this means local clients query something running on localhost, apparently
> dnsmasq.
> > So, is the above OK?  Is it the "right" way to do it?  ....etc.
> I recomment using nameservers the DHCP server provided, not override it
> unless you really know why.
As I said this *is* the DHCP server.  The second upstream server is
the one I get from my ISP ( that is).

> Also, I would put upstream nameservers to resolv.conf, so the resolving
> works even if dnsmasq fails, crashes or is killed.
> > The /etc/resolv.conf is written by /etc/init.d/dnsmasq and is, I
> > believe, correct so that dnsmasq does local cacheing.  However I'm not
> > sure about the upstream servers in /etc/dhcpcd.conf including the
> > local host as well.
> I don't see dnsmasq configuration here.
> I assume it's configured but I am not familiar to raspberry configuration...

Exactly my problem!  It's an 'out of the box' installation of dnsmasq
on a Raspberry Pi that I have changed to static IP so that it can act
as my local DNS/DHCP server.

Chris Green

More information about the Dnsmasq-discuss mailing list