Skip to content

Commit 821fb20

Browse files
authored
Merge pull request #83 from blinklabs-io/fix/query-root-domain
fix: special case for root domain query
2 parents d312e87 + 56d5ce3 commit 821fb20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/dns/dns.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ func findNameserversForDomain(
284284
// Split record name into labels and lookup each domain and parent until we get a hit
285285
queryLabels := dns.SplitDomainName(recordName)
286286

287+
// Special case for root domain
288+
if queryLabels == nil {
289+
queryLabels = append(queryLabels, "")
290+
}
291+
287292
// Check on-chain domains first
288293
for startLabelIdx := 0; startLabelIdx < len(queryLabels); startLabelIdx++ {
289294
lookupDomainName := strings.Join(queryLabels[startLabelIdx:], ".")

0 commit comments

Comments
 (0)