diff --git a/main.go b/main.go index dfb38bf..4fe65e5 100644 --- a/main.go +++ b/main.go @@ -338,6 +338,8 @@ func runConnection(options *Options, state *runState) { domainName = strings.ReplaceAll(domainName, "{random}", randString(randomLen)) } + log.Debug("Querying %s", domainName) + m := &dns.Msg{ MsgHdr: dns.MsgHdr{ Id: dns.Id(), @@ -352,9 +354,13 @@ func runConnection(options *Options, state *runState) { // Make sure we don't run faster than the pre-defined rate limit. state.rate.Take() + + // Send the DNS query. _, err := u.Exchange(m) if err == nil { + log.Debug("Query %s has been successfully processed", domainName) + _ = state.incProcessed() } else { _ = state.incErrors() diff --git a/main_test.go b/main_test.go index 5354f7d..2f7430e 100644 --- a/main_test.go +++ b/main_test.go @@ -66,7 +66,7 @@ func Test_runWithQueriesFile(t *testing.T) { example.com example.net` filePath := path.Join(os.TempDir(), "queries.txt") - err := os.WriteFile(filePath, []byte(str), 0644) + err := os.WriteFile(filePath, []byte(str), 0600) require.NoError(t, err) defer func() {