From 574ae1df75f570f455456e355916acc8703e4764 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Sat, 10 Dec 2022 12:17:00 -0600 Subject: [PATCH] fix(trace): Only trace when tracing DUH Signed-off-by: Sam Therapy --- main.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index f5c01b4..e7bf791 100644 --- a/main.go +++ b/main.go @@ -47,16 +47,18 @@ func run(args []string) (opts *util.Options, code int, err error) { ) for ok := true; ok; ok = keepTracing { - if keepTracing { - opts.Request.Name = tempDomain - opts.Request.Type = tempQueryType - } else { - tempDomain = opts.Request.Name - tempQueryType = opts.Request.Type + if opts.Trace { + if keepTracing { + opts.Request.Name = tempDomain + opts.Request.Type = tempQueryType + } else { + tempDomain = opts.Request.Name + tempQueryType = opts.Request.Type - // Override the query because it needs to be done - opts.Request.Name = "." - opts.Request.Type = dns.TypeNS + // Override the query because it needs to be done + opts.Request.Name = "." + opts.Request.Type = dns.TypeNS + } } // Retry queries if a query fails for i := 0; i <= opts.Request.Retries; i++ { -- 2.45.2