summaryrefslogtreecommitdiff
path: root/src/pkg/net/dnsconfig_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/net/dnsconfig_unix.go')
-rw-r--r--src/pkg/net/dnsconfig_unix.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pkg/net/dnsconfig_unix.go b/src/pkg/net/dnsconfig_unix.go
index 2f0f6c031..af288253e 100644
--- a/src/pkg/net/dnsconfig_unix.go
+++ b/src/pkg/net/dnsconfig_unix.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build darwin dragonfly freebsd linux netbsd openbsd
+// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
// Read system DNS config from /etc/resolv.conf
@@ -20,14 +20,13 @@ type dnsConfig struct {
// 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.
-// We assume it's in resolv.conf anyway.
-func dnsReadConfig() (*dnsConfig, error) {
- file, err := open("/etc/resolv.conf")
+func dnsReadConfig(filename string) (*dnsConfig, error) {
+ file, err := open(filename)
if err != nil {
return nil, &DNSConfigError{err}
}
conf := new(dnsConfig)
- conf.servers = make([]string, 3)[0:0] // small, but the standard limit
+ conf.servers = make([]string, 0, 3) // small, but the standard limit
conf.search = make([]string, 0)
conf.ndots = 1
conf.timeout = 5