dnsmasq: include IPv6 local nameserver entry
authorJoel Johnson <mrjoel@lixil.net>
Fri, 21 Aug 2020 14:32:00 +0000 (08:32 -0600)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 26 Oct 2020 17:51:35 +0000 (18:51 +0100)
For IPv6 native connections when using IPv6 DNS lookups, there is no
valid default resolver if ignoring WAN DHCP provided nameservers.

This uses a runtime check to determine if IPv6 is supported on the host.

Signed-off-by: Joel Johnson <mrjoel@lixil.net>
package/network/services/dnsmasq/files/dnsmasq.init

index 0fa3074f92ddab4c711208e16f9e86c8b09afd52..7ecc542b4469df02df70ce8f012fd01f45a58d91 100644 (file)
@@ -1066,6 +1066,7 @@ dnsmasq_start()
                        echo "search $DOMAIN" >> /tmp/resolv.conf
                }
                DNS_SERVERS="$DNS_SERVERS 127.0.0.1"
+               [ -e /proc/sys/net/ipv6 ] && DNS_SERVERS="$DNS_SERVERS ::1"
                for DNS_SERVER in $DNS_SERVERS ; do
                        echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf
                done