Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(608)

Issue 4431054: code review 4431054: net/dnsclient: try /etc/hosts before loading DNS config. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 9 months ago by dchest
Modified:
14 years, 9 months ago
Reviewers:
CC:
golang-dev, rsc1, rsc
Visibility:
Public.

Description

net/dnsclient: 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.

Patch Set 1 #

Patch Set 2 : diff -r 1405ca30d8be https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 1405ca30d8be https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r eeceadd8b619 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -5 lines) Patch
M src/pkg/net/dnsclient.go View 1 2 3 1 chunk +5 lines, -5 lines 0 comments Download

Messages

Total messages: 6
dchest
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years, 9 months ago (2011-04-20 14:39:18 UTC) #1
dchest
With the new DNS resolver (rev. cc0f39d02e93) the problem seems to be fixed. However, as ...
14 years, 9 months ago (2011-04-21 00:00:53 UTC) #2
rsc1
LGTM
14 years, 9 months ago (2011-04-21 13:16:28 UTC) #3
rsc1
Could you update the CL and rerun hg mail?
14 years, 9 months ago (2011-04-21 13:16:33 UTC) #4
dchest
Hello golang-dev@googlegroups.com, rsc1 (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 9 months ago (2011-04-21 13:20:33 UTC) #5
rsc
14 years, 9 months ago (2011-04-21 14:23:05 UTC) #6
*** Submitted as http://code.google.com/p/go/source/detail?r=0f20f6edc83e ***

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
http://codereview.appspot.com/4431054

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b