Skip to content

Instantly share code, notes, and snippets.

@miekg
Created October 15, 2017 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miekg/7c5d4176c82a49e7b9a8d2d18249e421 to your computer and use it in GitHub Desktop.
Save miekg/7c5d4176c82a49e7b9a8d2d18249e421 to your computer and use it in GitHub Desktop.
autopath logging patch
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