diff --git a/internal/dnsforward/dns.go b/internal/dnsforward/dns.go index b5f6c4ec..d86bda42 100644 --- a/internal/dnsforward/dns.go +++ b/internal/dnsforward/dns.go @@ -192,7 +192,11 @@ func (s *Server) onDHCPLeaseChanged(flags int) { func (s *Server) processInternalHosts(dctx *dnsContext) (rc resultCode) { req := dctx.proxyCtx.Req q := req.Question[0] - if q.Qtype != dns.TypeA { + + // Go on processing the AAAA request despite the fact that we don't + // support it yet. The expected behavior here is to respond with an + // empty asnwer and not NXDOMAIN. + if q.Qtype != dns.TypeA && q.Qtype != dns.TypeAAAA { return resultCodeSuccess } diff --git a/internal/dnsforward/dns_test.go b/internal/dnsforward/dns_test.go index 682a12c5..188d0705 100644 --- a/internal/dnsforward/dns_test.go +++ b/internal/dnsforward/dns_test.go @@ -52,6 +52,14 @@ func TestServer_ProcessInternalHosts(t *testing.T) { wantIP: nil, qtyp: dns.TypeA, wantRes: resultCodeSuccess, + }, { + name: "success_internal_aaaa", + host: "example.lan", + suffix: defaultAutohostSuffix, + wantErrMsg: "", + wantIP: nil, + qtyp: dns.TypeAAAA, + wantRes: resultCodeSuccess, }} for _, tc := range testCases { @@ -92,7 +100,14 @@ func TestServer_ProcessInternalHosts(t *testing.T) { } pctx := dctx.proxyCtx - if tc.wantIP == nil { + if tc.qtyp == dns.TypeAAAA { + // TODO(a.garipov): Remove this special handling + // when we fully support AAAA. + require.NotNil(t, pctx.Res) + + ans := pctx.Res.Answer + require.Len(t, ans, 0) + } else if tc.wantIP == nil { assert.Nil(t, pctx.Res) } else { require.NotNil(t, pctx.Res)