[OpenWrt-Devel] [PATCH] dnsmasq: prefer localuse over resolvfile guesswork

Yousong Zhou yszhou4tech at gmail.com
Thu Feb 21 20:54:37 EST 2019


On Thu, 21 Feb 2019 at 22:14, Paul Oranje <por at oranjevos.nl> wrote:
>
>
>
> > Op 21 feb. 2019, om 04:52 heeft Yousong Zhou <yszhou4tech at gmail.com> het volgende geschreven:
> >
> > This makes it clear that localuse when explicitly specified in the
> > config will have its final say on whether or not the initscript should
> > touch /etc/resolv.conf, no matter whatever the result of previous
> > guesswork would be
> >
> > Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>

<snipped>

>
> Tested this patch (8f16fba501) and the previous patch (ec2a2a2aea) on top of 18.06.2.
>
> The patches apply cleanly and the patched file works as expected:
>
> - localuse=1 and noresolv and resolvfile not set => dnsmasq writes resolv.conf
> - localuse and noresolv and resolvfile not set => dnsmasq writes resolv.conf
> - localuse=0 and noresolv and resolvfile not set => dnsmasq leaves resolv.conf untouched
> - localuse not set and noresolv=1 and resolvfile='/tmp/resolv.conf.auto' => dnsmasq leaves resolv.conf untouched.
>
> The latter two scenario's work well with Unbound (where dnsmasq handles DHCP and DNS of lan host names).
> Thanks.
>
> Tested-by: Paul Oranje <por at oranjevos.nl>

Thanks ;)

>
> Sitenotes:
> Would also writing "nameserver ::1" to resolv.conf be a good idea ? (Unbound does)

The 127.0.0.1 address always works so there is no need for ::1 plus
the possibility that people may use a build without ipv6.

> When dnsmasq does not listen on port 53, then it cannot serve as the nameserver for the localhost (resolv.conf does not allow specifying a port) unless some clever DNAT rule is in place.

Yes, I got the same conclusion last time I tried to find ways to
specify port in resolv.conf ;)

                yousong

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list