We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What happened:
When submitting request using IPv6, the state.QType() of the request is dns.TypeA.
state.QType()
dns.TypeA
state.Family() correctly denotes the request is IPv6.
state.Family()
What you expected to happen:
I would think that state.Family() returning 2, which correctly denotes the request is IPv6, would set the state.QType() to dns.TypeAAAA.
2
dns.TypeAAAA
How to reproduce it (as minimally and precisely as possible):
Start CoreDNS with a plugin that prints dns.TypeToString[state.QType()].
dns.TypeToString[state.QType()]
Submit a request using dig -6 example.com.
dig -6 example.com
Anything else we need to know?:
I'm not sure this is a bug or not, but this does seem pretty counter-intuitive.
In a plugin I'm developing, I'm currently using the following code to correct this:
func (m *MyPlugin) ServeDNS(ctx context.Context, w dns.ResponseWriter,r *dns.Msg) (int, error) { state := request.Request{W: w, Req: r} qtype := fixQType(state) . . . } func fixQType(state request.Request) uint16 { var qtype uint16 switch state.QType() { case dns.TypeA, dns.TypeAAAA: switch state.Family() { case 1: qtype = dns.TypeA case 2: qtype = dns.TypeAAAA } return qtype default: return state.QType() } }
Environment:
v1.11.3
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What happened:
When submitting request using IPv6, the
state.QType()
of the request isdns.TypeA
.state.Family()
correctly denotes the request is IPv6.What you expected to happen:
I would think that
state.Family()
returning2
, which correctly denotes the request is IPv6,would set the
state.QType()
todns.TypeAAAA
.How to reproduce it (as minimally and precisely as possible):
Start CoreDNS with a plugin that prints
dns.TypeToString[state.QType()]
.Submit a request using
dig -6 example.com
.Anything else we need to know?:
I'm not sure this is a bug or not, but this does seem pretty counter-intuitive.
In a plugin I'm developing, I'm currently using the following code to correct this:
Environment:
v1.11.3
The text was updated successfully, but these errors were encountered: