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: support "ndots:" of 0 in resolv.conf? #15419
Labels
Milestone
Comments
bradfitz
changed the title
It does not work when set "ndots:" to 0 in resolv.conf
net: support "ndots:" of 0 in resolv.conf?
Apr 23, 2016
/cc @mdempsky |
Allowing ndots to go down to 0 seems okay to me. Package net should handle that correctly, and BIND libresolv allows it. OpenBSD libc only allows ndots to go down to 1. I don't see any reason for that though, so I'm wondering if it's an off-by-1. (Instead of allowing 0--15 like BIND, OpenBSD allows 1--16.) |
bombela
added a commit
to yarpc/yarpc-go
that referenced
this issue
Jun 20, 2016
- the native go DNS resolver doesn't handle `ndots:0` anyway (golang/go#15419) - we might as well set our containers DNS configuration to absolute hostnames for consistency.
bombela
added a commit
to crossdock/crossdock
that referenced
this issue
Jun 20, 2016
- the native go DNS resolver doesn't handle `ndots:0` anyway (golang/go#15419) - we might as well set our containers DNS configuration to absolute hostnames for consistency.
bombela
added a commit
to yarpc/yarpc-go
that referenced
this issue
Jun 20, 2016
- the native go DNS resolver doesn't handle `ndots:0` anyway (golang/go#15419) - we might as well set our containers DNS configuration to absolute hostnames for consistency.
bombela
added a commit
to crossdock/crossdock
that referenced
this issue
Jun 20, 2016
- the native go DNS resolver doesn't handle `ndots:0` anyway (golang/go#15419) - we might as well set our containers DNS configuration to absolute hostnames for consistency.
CL https://golang.org/cl/24901 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
Aug 17, 2016
Updates #15419. Change-Id: If7c80adcb38b5731e337b2ae2d9d76fcf8513d8e Reviewed-on: https://go-review.googlesource.com/27271 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I saw the source code of net/dnsconfig_unix.go line 84:
And found that if the value of "ndots:" less than 1, it will be set to 1. But does this make sense? Why can't it be set to 0?
The way how pure Go DNS resolver resolves names caused an error in my program. When I set "ndots:" to 0 and resolved "mysql", I wanted to resolve "mysql." first, but instead, pure Go DNS resolver resolved "mysql.searchdomain." first. As it happened, the domain name"mysql.searchdomain." was valid in my DNS server, so I got a wrong IP of mysql.
When I set "GODEBUG=netdns=cgo" and used the cgo-based resolver, the program worked well.
The text was updated successfully, but these errors were encountered: