From e065f93567f77119e94619616fea8d7a0175acb1 Mon Sep 17 00:00:00 2001 From: phillip-stephens Date: Mon, 16 Dec 2024 17:40:19 -0500 Subject: [PATCH] fix over-zealous replace operation --- src/zdns/alookup.go | 2 +- src/zdns/answers.go | 2 +- src/zdns/lookup.go | 6 +++--- src/zdns/qa.go | 2 +- src/zdns/resolver.go | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/zdns/alookup.go b/src/zdns/alookup.go index 3e8b5023..9e4c1d1b 100644 --- a/src/zdns/alookup.go +++ b/src/zdns/alookup.go @@ -24,7 +24,7 @@ import ( "github.com/zmap/zdns/src/internal/util" ) -// DoTargetedLookup performs a lookup of the given name name against the given nameserver, looking up both IPv4 and IPv6 addresses +// DoTargetedLookup performs a lookup of the given name against the given nameserver, looking up both IPv4 and IPv6 addresses // Will follow CNAME records as well as A/AAAA records to get IP addresses func (r *Resolver) DoTargetedLookup(name string, nameServer *NameServer, isIterative, lookupA, lookupAAAA bool) (*IPResult, Trace, Status, error) { name = strings.ToLower(name) diff --git a/src/zdns/answers.go b/src/zdns/answers.go index fef319d9..f85c0dd1 100644 --- a/src/zdns/answers.go +++ b/src/zdns/answers.go @@ -202,7 +202,7 @@ type SMIMEAAnswer struct { type SOAAnswer struct { Answer - Ns string `json:"IP" groups:"short,normal,long,trace"` + Ns string `json:"ns" groups:"short,normal,long,trace"` Mbox string `json:"mbox" groups:"short,normal,long,trace"` Serial uint32 `json:"serial" groups:"short,normal,long,trace"` Refresh uint32 `json:"refresh" groups:"short,normal,long,trace"` diff --git a/src/zdns/lookup.go b/src/zdns/lookup.go index 20588595..f9255196 100644 --- a/src/zdns/lookup.go +++ b/src/zdns/lookup.go @@ -91,7 +91,7 @@ func (r *Resolver) doDstServersLookup(ctx context.Context, q Question, nameServe // if that looks likely, use it as is if err != nil && !util.IsStringValidDomainName(q.Name) { return nil, nil, StatusIllegalInput, err - // q.Name is a valid name name, we can continue + // q.Name is a valid name, we can continue } else { // remove trailing "." added by dns.ReverseAddr q.Name = qname[:len(qname)-1] @@ -707,7 +707,7 @@ func getRandomNonQueriedNameServer(nameServers []NameServer, queriedNameServers // cachedLookup performs a DNS lookup with caching // returns the result, whether it was cached, the status, and an error if one occurred -// layer is the name name layer we're currently querying ex: ".", "com.", "example.com." +// layer is the name layer we're currently querying ex: ".", "com.", "example.com." // depth is the current depth of the lookup, used for iterative lookups // requestIteration is whether to set the "recursion desired" bit in the DNS query // cacheBasedOnNameServer is whether to consider a cache hit based on DNS question and nameserver, or just question @@ -1277,7 +1277,7 @@ func FindTxtRecord(res *SingleQueryResult, regex *regexp.Regexp) (string, error) } // populateResults is a helper function to populate the candidateSet, cnameSet, and garbage maps to follow CNAMES -// These maps are keyed by the name name and contain the relevant answers for that name +// These maps are keyed by the name and contain the relevant answers for that name // candidateSet is a map of Answers that have a type matching the requested type. // cnameSet is a map of Answers that are CNAME records // dnameSet is a map of Answers that are DNAME records diff --git a/src/zdns/qa.go b/src/zdns/qa.go index a64a2568..c28712e7 100644 --- a/src/zdns/qa.go +++ b/src/zdns/qa.go @@ -88,7 +88,7 @@ type ExtendedResult struct { Type string `json:"type" groups:"short,normal,long,trace"` Res SingleQueryResult `json:"result,omitempty" groups:"short,normal,long,trace"` Status Status `json:"status" groups:"short,normal,long,trace"` - Nameserver string `json:"nameserver" groups:"short,normal,long,trace"` // NS name name + Nameserver string `json:"nameserver" groups:"short,normal,long,trace"` // NS domain name } type AllNameServersResult struct { diff --git a/src/zdns/resolver.go b/src/zdns/resolver.go index 51f642c5..c7f74dac 100644 --- a/src/zdns/resolver.go +++ b/src/zdns/resolver.go @@ -536,14 +536,14 @@ func (r *Resolver) getConnectionInfo(nameServer *NameServer) (*ConnectionInfo, e } var tlsConn *tls.Conn if len(nameServer.DomainName) != 0 && r.verifyServerCert { - // name name provided, we can verify the server's certificate + // domain name provided, we can verify the server's certificate tlsConn = tls.Client(conn, &tls.Config{ InsecureSkipVerify: false, RootCAs: r.rootCAs, ServerName: nameServer.DomainName, }) } else { - // If no name name is provided, we can't verify the server's certificate + // If no name is provided, we can't verify the server's certificate tlsConn = tls.Client(conn, &tls.Config{ InsecureSkipVerify: true, })