Unifying DNS from /etc/resolv.conf function

As part of v1.4.0 release, reading DNS from /etc/resolv.conf file is
only available for Macos. However, there's no reason to prevent this
function from working on other *nix systems.

This commit unify the function to *nix, so it could be added as DNS
source for Linux and Freebsd.
This commit is contained in:
Cuong Manh Le
2025-04-15 18:51:56 +07:00
committed by Cuong Manh Le
parent 0c2cc00c4f
commit c06c8aa859
6 changed files with 63 additions and 53 deletions

View File

@@ -584,7 +584,7 @@ func NewPrivateResolver() Resolver {
}
nss := *or.lanServers.Load()
resolverMutex.Unlock()
resolveConfNss := nameserversFromResolvconf()
resolveConfNss := currentNameserversFromResolvconf()
localRfc1918Addrs := Rfc1918Addresses()
n := 0
for _, ns := range nss {