-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: use Go DNS resolver when nsswitch.conf permits #10485
Comments
Here is the default one on the solaris builder
|
This is the default one for the netbsd/386 builder:
|
FreeBSD 10:
|
Ubuntu 14.04:
|
Arch with Avahi.
|
Ubuntu 14.04.02
|
On OpenBSD there's no nsswitch.conf file. Instead, host resolution database ordering is controlled by the "lookup" option in /etc/resolv.conf. E.g., "lookup bind file" (the default) means to check DNS, then fall back to /etc/hosts. There are also no "criterion" like in nsswitch.conf files, just a list of databases. See http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/resolv.conf.5 |
|
Linux ncegcolnx329 3.0.13-0.27-default #1 SMP Wed Feb 15 13:33:49 UTC 2012 (d73692b) x86_64 x86_64 x86_64 GNU/Linux A SLES11 SP2 box, running in a corporate environment using centrify:
|
openSUSE 13.2
|
Xen.org XCP Host 1.6.10-61809c
Debian squeeze (6.0) LTS
|
Gentoo with net-dns/avahi-0.6.31-r6
|
A customized file I've used on Ubuntu 10.04/12.04/14.04 with sssd:
|
Ubuntu 14.10
|
Debian Jessie
|
CoreOS
|
Please note, that So a way to switch this assumption off in Go is needed. |
@nightlyone, I know that local doesn't mean Avahi. But I also know that it's not a valid DNS TLD and Go doesn't do mDNS or Active Directory etc. So if it is seen, we use C like before. Why do you need a switch for that assumption? |
Amazon Linux AMI 2014.09 # # /etc/nsswitch.conf # # An example Name Service Switch config file. This file should be # sorted with the most-used services at the beginning. # # The entry '[NOTFOUND=return]' means that the search for an # entry should stop if the search in the previous entry turned # up nothing. Note that if the search failed due to some other reason # (like no NIS server responding) then the search continues with the # next entry. # # Valid entries include: # # nisplus Use NIS+ (NIS version 3) # nis Use NIS (NIS version 2), also called YP # dns Use DNS (Domain Name Service) # files Use the local files # db Use the local database (.db) files # compat Use NIS on compat mode # hesiod Use Hesiod for user lookups # [NOTFOUND=return] Stop searching if not found so far # # To use db, put the "db" in front of "files" for entries you want to be # looked up first in the databases # # Example: #passwd: db files nisplus nis #shadow: db files nisplus nis #group: db files nisplus nis passwd: files shadow: files group: files #hosts: db files nisplus nis dns hosts: files dns # Example - obey only what nisplus tells us... #services: nisplus [NOTFOUND=return] files #networks: nisplus [NOTFOUND=return] files #protocols: nisplus [NOTFOUND=return] files #rpc: nisplus [NOTFOUND=return] files #ethers: nisplus [NOTFOUND=return] files #netmasks: nisplus [NOTFOUND=return] files bootparams: nisplus [NOTFOUND=return] files ethers: files netmasks: files networks: files protocols: files rpc: files services: files netgroup: files publickey: nisplus automount: files aliases: files nisplus |
As an extra kink for [server]
#host-name=foo
#domain-name=local Beyond avahi unless there is an explicit and well documented switch to force the use of the libc resolver this feels like a can of worms. There are a variety of options that can be set in /etc/host.conf (influences /etc/hosts) /etc/gai.conf (influences getaddrinfo in general) as well as the usual /etc/resolv.conf and /etc/nsswitch.conf. In the mind of a sysadmin or a distro maintainer I really need a way to tell Go to use libc because it isn't practical for Go to reliably know when its behavior differs from libc. |
@bradfitz i would argue that local is a valid dns top-level domain but it has special treatment as you say "Any DNS query for a name ending with ".local." MUST be sent to the mDNS IPv4 link-local multicast address 224.0.0.251" http://tools.ietf.org/html/rfc6762 |
openSUSE 13.2
|
FreeBSD 10.1, almost stock, but I've added
|
Fedora 21. I seem to recall that I modified it from stock in order to favor IPv6 for mDNS since more of my devices are IPv6 than IPv4. Initial comment paragraphs stripped.
|
Debian 7.8
Same comments apply. |
Looks like this issue was fixed by https://go.googlesource.com/go/+/4a0ba7aa171a80fe798811a3fdc7c42b83dcda01. |
We should prefer the Go DNS resolver (over libc's) if the /etc/nsswitch.conf file permits, to avoid the cgo & thread overhead.
Initial CL is https://go-review.googlesource.com/8945
But before I submit that, I want to gather a bunch of
/etc/nsswitch.conf
files from different systems for more test data.Please post yours here if it's unique.
Please include the OS/distro/version information, and which interesting OS packages you might have installed (e.g. Avahi) or not. Whatever's interesting info.
Thanks.
The text was updated successfully, but these errors were encountered: