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: LookupHost only using the first configure DNS server in /etc/resolv.conf on Linux #16215
Comments
/cc @mdempsky for triage |
Are you able to give more details about how the first DNS server isn't working properly? E.g., is it not sending responses at all? Is it sending bogus responses? What's it doing? nmap or strace captures of the DNS transaction would be most helpful. |
I don't have control over the server but it seems like it can connect to it but the server says it can't find anything. nslookup some.domain.com Non-authoritative answer: FYI I did nslookup on the actual domain not the placeholder some.domain.com and 75.x.x.190 is the DNS server. |
Can you please retry your test with dig instead of nslookup? |
; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7_2.3 <<>> some.domain.com ;; OPT PSEUDOSECTION: ;; Query time: 187 msec |
I assume 75.x.x.190 is the first server in your /etc/resolv.conf? Can you run "dig some.domain.com @$server2", where $server2 is the IP address for the second nameserver in your /etc/resolv.conf? Can you also provide the output from running "host some.domain.com"? |
if I modify the standard libarry, what command should I use to make Go rebuild the net package after I implement the fix? |
|
thank you, I manually fixed it. |
Glad to hear that! :) |
Please answer these questions before submitting your issue. Thanks!
go version
)?1.5.1, 1.6.2
go env
)?linux_amd64
I have a /etc/resolv.conf file with three DNS servers configured. If the first one isn't working properly, the net.LookupHost function will not try to use the other two DNS servers. It used to try all the DNS servers in 1.4.2. But I tested the function in newer versions such as 1.5.1 and 1.6.2, but I get an error saying the first DNS server couldn't resolve my hostname.
The text was updated successfully, but these errors were encountered: