]> Cypherpunks repositories - gostls13.git/commit
net: make go DNS use localhost if resolv.conf is missing or empty
authorAlex A Skinner <alex@lx.lc>
Sun, 26 Apr 2015 00:50:21 +0000 (20:50 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 30 Apr 2015 18:19:00 +0000 (18:19 +0000)
commitf390135733ae20a3c8b6700426cc379f6e145319
treecf99a78fd97b0ca8fc0a387726f7c8d70af78d83
parent7556948ebf1c1d739c2fa3b06a0b9bc10e4f150d
net: make go DNS use localhost if resolv.conf is missing or empty

Per resolv.conf man page, "If this file does not exist, only the name
server on the local machine will be queried."

This behavior also occurs if file is present but unreadable,
or if no nameservers are listed.

Fixes #10566

Change-Id: Id5716da0eae534d5ebfafea111bbc657f302e307
Reviewed-on: https://go-review.googlesource.com/9380
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/conf.go
src/net/conf_test.go
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go
src/net/dnsconfig_unix.go
src/net/dnsconfig_unix_test.go
src/net/error_test.go
src/net/net.go