Skip to content

Commit

Permalink
Merge pull request #83 from blinklabs-io/fix/query-root-domain
Browse files Browse the repository at this point in the history
fix: special case for root domain query
  • Loading branch information
agaffney authored Nov 22, 2023
2 parents d312e87 + 56d5ce3 commit 821fb20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ func findNameserversForDomain(
// Split record name into labels and lookup each domain and parent until we get a hit
queryLabels := dns.SplitDomainName(recordName)

// Special case for root domain
if queryLabels == nil {
queryLabels = append(queryLabels, "")
}

// Check on-chain domains first
for startLabelIdx := 0; startLabelIdx < len(queryLabels); startLabelIdx++ {
lookupDomainName := strings.Join(queryLabels[startLabelIdx:], ".")
Expand Down

0 comments on commit 821fb20

Please sign in to comment.