]> Cypherpunks repositories - gostls13.git/commit
net: try /etc/hosts before loading DNS config.
authorDmitry Chestnykh <dchest@gmail.com>
Thu, 21 Apr 2011 14:23:03 +0000 (10:23 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 21 Apr 2011 14:23:03 +0000 (10:23 -0400)
commita260de44e96edbd7e4e99e0c73ba2960460ffc25
tree7bb516f1b9b3605378e6dea369ec668e4d7b0ba0
parent338b7abdfc2c44911e3025f81e39eaa496998449
net: try /etc/hosts before loading DNS config.

On Mac X 10.6 /etc/resolv.conf is changed dynamically,
and may not exist at all when all network connections
are turned off, thus any lookup, even for "localhost"
would fail with "error reading DNS config: open
/etc/resolv.conf: no such file or directory". This
change avoids the error by trying to lookup addresses
in /etc/hosts before loading DNS config.

R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4431054
src/pkg/net/dnsclient.go