From 56d5ce3f77cc05f7f78cda9acf9b51b44fd3df1a Mon Sep 17 00:00:00 2001 From: Aurora Gaffney Date: Wed, 22 Nov 2023 16:17:10 -0600 Subject: [PATCH] fix: special case for root domain query --- internal/dns/dns.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/dns/dns.go b/internal/dns/dns.go index 01582e2..0819ce9 100644 --- a/internal/dns/dns.go +++ b/internal/dns/dns.go @@ -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:], ".")