Created
October 15, 2017 08:33
-
-
Save miekg/7c5d4176c82a49e7b9a8d2d18249e421 to your computer and use it in GitHub Desktop.
autopath logging patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/plugin/autopath/autopath.go b/plugin/autopath/autopath.go | |
index aa3d44e6..f52ee516 100644 | |
--- a/plugin/autopath/autopath.go | |
+++ b/plugin/autopath/autopath.go | |
@@ -104,6 +104,8 @@ func (a *AutoPath) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Ms | |
ar.Question[0].Name = newQName | |
nw := nonwriter.New(w) | |
+ log.Printf("[INFO] Querying %s", newQName) | |
+ | |
rcode, err := plugin.NextOrFailure(a.Name(), a.Next, ctx, nw, ar) | |
if err != nil { | |
// Return now - not sure if this is the best. We should also check if the write has happened. | |
@@ -120,6 +122,7 @@ func (a *AutoPath) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Ms | |
} | |
if nw.Msg.Rcode == dns.RcodeNameError { | |
+ log.Printf("[INFO] NXDOMAIN for %s, continuing search", newQName) | |
continue | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment