Skip to content
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: DNS lookups do not include host name suffix as a search domain #14897

Closed
bhiggins opened this issue Mar 21, 2016 · 2 comments
Closed

net: DNS lookups do not include host name suffix as a search domain #14897

bhiggins opened this issue Mar 21, 2016 · 2 comments
Milestone

Comments

@bhiggins
Copy link

@bhiggins bhiggins commented Mar 21, 2016

src/net/dnsconfig_unix.go has this comment:

// See resolv.conf(5) on a Linux machine.
// TODO(rsc): Supposed to call uname() and chop the beginning
// of the host name to get the default search domain.

...which succinctly describes the issue.

Here's an example: Given a server with uname -n "foo.x.y.z" where /etc/resolv.conf only has nameserver lines, and with another server with hostname "bar.x.y.z", net.LookupHost("bar") results in "no such host" when using the built-in DNS resolver, but succeeds when running with "GODEBUG=netdns=cgo".

go version: go version go1.6 linux/amd64

go env:
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ben/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="x86_64-pc-linux-gnu-gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="x86_64-pc-linux-gnu-g++"
CGO_ENABLED="1"

@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Mar 21, 2016
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Mar 21, 2016

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Apr 2, 2016

CL https://golang.org/cl/21464 mentions this issue.

@gopherbot gopherbot closed this in cbd7231 Apr 27, 2016
@golang golang locked and limited conversation to collaborators Apr 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.