From 5647a37ffebae8aeb34d0b63abaf590b2d49e081 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 27 Jul 2015 23:22:36 +0200 Subject: [PATCH] Recurse when PTR answer is empty --- command/agent/dns.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/agent/dns.go b/command/agent/dns.go index 15c343228d..5e7429db9c 100644 --- a/command/agent/dns.go +++ b/command/agent/dns.go @@ -209,6 +209,12 @@ func (d *DNSServer) handlePtr(resp dns.ResponseWriter, req *dns.Msg) { } } + // nothing found locally, recurse + if len(m.Answer) == 0 { + d.handleRecurse(resp, req) + return + } + // Write out the complete response if err := resp.WriteMsg(m); err != nil { d.logger.Printf("[WARN] dns: failed to respond: %v", err)