diff --git a/pkg/server/dns_server.go b/pkg/server/dns_server.go index a4dd5fcf..8fb0ab2c 100644 --- a/pkg/server/dns_server.go +++ b/pkg/server/dns_server.go @@ -305,18 +305,18 @@ func (h *DNSServer) handleInteraction(domain string, w dns.ResponseWriter, r *dn } } } - } - } else { - parts := strings.Split(domain, ".") - for i, part := range parts { - for partChunk := range stringsutil.SlideWithLength(part, h.options.GetIdLength()) { - normalizedPartChunk := strings.ToLower(partChunk) - if h.options.isCorrelationID(normalizedPartChunk) { - fullID = part - if i+1 <= len(parts) { - fullID = strings.Join(parts[:i+1], ".") + } else { + parts := strings.Split(domain, ".") + for i, part := range parts { + for partChunk := range stringsutil.SlideWithLength(part, h.options.GetIdLength()) { + normalizedPartChunk := strings.ToLower(partChunk) + if h.options.isCorrelationID(normalizedPartChunk) { + fullID = part + if i+1 <= len(parts) { + fullID = strings.Join(parts[:i+1], ".") + } + uniqueID = normalizedPartChunk } - uniqueID = normalizedPartChunk } } }