Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: Dial timeout reports incorrect problem DNS entry #17329

Closed
dtcaciuc opened this issue Oct 3, 2016 · 4 comments

Comments

Projects
None yet
5 participants
@dtcaciuc
Copy link
Contributor

commented Oct 3, 2016

What version of Go are you using (go version)?

go version go1.7 linux/amd64

What operating system and processor architecture are you using (go env)?

linux_amd64, scilinux 6.3

What did you do?

  1. Have two nameserver entries in /etc/resolve.conf; first one is the invalid, second one is valid.
  2. Run the test program
package main

import (
    "fmt"
    "net/http"
)

func main() {
    _, err := http.Get("https://www.google.ca/")
    if err != nil {
        fmt.Println(err)
    }
}

What did you expect to see?

Timeout message reporting the invalid nameserver IP

What did you see instead?

Timeout message erroneously reporting the second valid nameserver IP

@bradfitz bradfitz added this to the Go1.8Maybe milestone Oct 3, 2016

@bradfitz bradfitz added the help wanted label Oct 3, 2016

@bradfitz

This comment has been minimized.

Copy link
Member

commented Oct 3, 2016

@vcabbage

This comment has been minimized.

Copy link
Member

commented Oct 4, 2016

I think this was fixed in 1.7.1 by https://golang.org/cl/28057

I was able to reproduce this with the Go resolver on 1.7:

# cat /etc/resolv.conf
nameserver 8.8.8.9
nameserver 8.8.8.8
# go version
go version go1.7 linux/amd64
# GODEBUG=netdns=go+2 go run main.go
go package net: GODEBUG setting forcing use of Go's resolver
go package net: hostLookupOrder(www.google.ca) = files,dns
lookup www.google.ca on 8.8.8.8:53: dial udp 8.8.8.8:53: i/o timeout
exit status 1

With Go 1.7.1 the sample program correctly resolves the address:

# cat /etc/resolv.conf
nameserver 8.8.8.9
nameserver 8.8.8.8
# go version
go version go1.7.1 linux/amd64
# GODEBUG=netdns=go+2 go run main.go
go package net: GODEBUG setting forcing use of Go's resolver
go package net: hostLookupOrder(www.google.ca) = files,dns
[172.217.3.163 2607:f8b0:400a:801::2003]

(The cgo resolver did not exhibit the issue for 1.7 or 1.7.1)

Note that I modified the demo program to just do the DNS lookup:

package main

import (
    "fmt"
    "net"
    "os"
)

func main() {
    ips, err := net.LookupIP("www.google.ca")
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
    fmt.Println(ips)
}
@bradfitz

This comment has been minimized.

Copy link
Member

commented Oct 4, 2016

@vcabbage, oh, thanks. I missed the "go1.7" in the original report.

@bradfitz bradfitz closed this Oct 4, 2016

@mikioh mikioh modified the milestones: Go1.7.1, Go1.8Maybe Oct 5, 2016

@mikioh

This comment has been minimized.

Copy link
Contributor

commented Oct 5, 2016

This is a duplicate of #16865.

@golang golang locked and limited conversation to collaborators Oct 5, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.