Dont append the default port to the nameservers
This commit is contained in:
parent
17d3f12d31
commit
d5c309e8d8
|
@ -25,9 +25,8 @@ type ClientConfig struct {
|
||||||
Attempts int // lost packets before giving up on server
|
Attempts int // lost packets before giving up on server
|
||||||
}
|
}
|
||||||
|
|
||||||
// See resolv.conf(5) on a Linux machine.
|
// ClientConfigFromFile parses a resolv.conf(5) like file and returns
|
||||||
// Parse a /etc/resolv.conf like file and return a filled out ClientConfig. Note
|
// a *ClientConfig.
|
||||||
// that all nameservers will have the default port number appended (:53)
|
|
||||||
func ClientConfigFromFile(conf string) (*ClientConfig, error) {
|
func ClientConfigFromFile(conf string) (*ClientConfig, error) {
|
||||||
file, err := os.Open(conf)
|
file, err := os.Open(conf)
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
@ -62,7 +61,7 @@ func ClientConfigFromFile(conf string) (*ClientConfig, error) {
|
||||||
fallthrough
|
fallthrough
|
||||||
case 4:
|
case 4:
|
||||||
a = a[0 : n+1]
|
a = a[0 : n+1]
|
||||||
a[n] = name + ":53"
|
a[n] = name
|
||||||
c.Servers = a
|
c.Servers = a
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue