From 0bc4d9322e4bce7e5802f6ec8f285ea8cccc537c Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 8 Sep 2015 15:54:13 +0200 Subject: [PATCH] Allow AAAA queries for nodeLookup --- command/agent/dns.go | 4 ++-- command/agent/dns_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/command/agent/dns.go b/command/agent/dns.go index 5c4a53adc5..35830648e3 100644 --- a/command/agent/dns.go +++ b/command/agent/dns.go @@ -352,9 +352,9 @@ INVALID: // nodeLookup is used to handle a node query func (d *DNSServer) nodeLookup(network, datacenter, node string, req, resp *dns.Msg) { - // Only handle ANY and A type requests + // Only handle ANY, A and AAAA type requests qType := req.Question[0].Qtype - if qType != dns.TypeANY && qType != dns.TypeA { + if qType != dns.TypeANY && qType != dns.TypeA && qType != dns.TypeAAAA { return } diff --git a/command/agent/dns_test.go b/command/agent/dns_test.go index b4d7018a24..aafc7c3902 100644 --- a/command/agent/dns_test.go +++ b/command/agent/dns_test.go @@ -293,7 +293,7 @@ func TestDNS_NodeLookup_AAAA(t *testing.T) { } m := new(dns.Msg) - m.SetQuestion("bar.node.consul.", dns.TypeANY) + m.SetQuestion("bar.node.consul.", dns.TypeAAAA) c := new(dns.Client) addr, _ := srv.agent.config.ClientListener("", srv.agent.config.Ports.DNS)