-
Notifications
You must be signed in to change notification settings - Fork 18k
net: Go's DNS resolver retry AAAA request to next nameserver even A response has records #64783
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
Comments
Does CL 550435 help with this?
|
Yes, but there has two problem, CL 550435 only fix one.
|
First of all your resolvers are not recursive. All resolvers in I suspect that CL 550435 helps, because the responses have an EDNS(0) resource (arcount != 0), so that the
What do you mean that there are two problems? What it fixes? What it did not fix? |
@ianlancetaylor @neild per owners |
Duplicate of #57697 |
Change https://go.dev/cl/550435 mentions this issue: |
…se from the DNS server. CL https://golang.org/cl/37879 migrates DNS message parsing to the golang.org/x/net/dns/dnsmessage package. However, during the modification of the "lame referral" error check introduced by CL https://golang.org/cl/22428, a condition was overlooked. This omission results in unexpected retries when a DNS server returns an empty response (not an invalid response, but one that includes an additional section). Fixes #57697 Fixes #64783 Change-Id: I203896aa2902c305569005c1712fd2f9f13a9b6b Reviewed-on: https://go-review.googlesource.com/c/go/+/550435 LUCI-TryBot-Result: Go LUCI <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Damien Neil <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Reviewed-by: Dexter Ouyang <[email protected]>
Change https://go.dev/cl/565295 mentions this issue: |
Change https://go.dev/cl/565296 mentions this issue: |
Go version
go version go1.21.5 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Problem
here is
/etc/resolv.conf
we have some private domain, it's only has A records, no AAAA, I use

net.Dial("tcp", "domain:80")
start a connect, the Go's DNS resolver retry AAAA request to next nameserver even A response has records.if use cgo, no retry. like

go build -tags 'netcgo'
same program, the result is:Reason
we debug find hit the errLameReferral error. but in glibc, it's different.
in glibc A or AAAA anyone has records, no retry.
What did you expect to see?
if domain A type response has records, no AAAA retry, if domain AAAA type response has records, no A retry.
What did you see instead?
if domain A type response has records, AAAA has no record, AAAA request retry to next nameserver.
The text was updated successfully, but these errors were encountered: