Go Built-in DNS Resolver only accept 1 nameserver from /etc/resolv.conf

I was wondering if it was intentional that Go’s Built-in DNS resolver only accepts one nameserver from the /etc/resolv.conf file.

Looking at these two lines https://github.com/golang/go/blob/go1.16/src/net/dnsconfig_unix.go#L19 and https://github.com/golang/go/blob/go1.16/src/net/dnsconfig_unix.go#L73 means that at most only one nameserver will be added to the list, because the nameserver list is pre-polulated with 2 local addresses, so that only leave room to one more.

I see the comment in line 72:

case "nameserver": // add one name server

But it seems a bit ambiguous on its meaning, as in “add one name server in general” or “add one name server on this case”.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.