From e6761954c026aa8010373712c8cf5df5a840f7e6 Mon Sep 17 00:00:00 2001 From: primal Date: Mon, 2 Feb 2026 20:55:57 -0500 Subject: [PATCH] Use system DNS resolver instead of custom infra-dns infra-dns container has UDP connectivity issues to upstream DNS. System resolver works (proven via wget test). Co-Authored-By: Claude Opus 4.5 --- crawler.go | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/crawler.go b/crawler.go index 85fa706..4233537 100644 --- a/crawler.go +++ b/crawler.go @@ -145,26 +145,11 @@ func (c *Crawler) StartMaintenanceLoop() { } } -// dnsResolver uses local caching DNS (infra-dns) with fallback to system -var dnsResolver = &net.Resolver{ - PreferGo: true, - Dial: func(ctx context.Context, network, address string) (net.Conn, error) { - d := net.Dialer{Timeout: 2 * time.Second} - // Try local caching DNS first (CoreDNS on proxy network) - conn, err := d.DialContext(ctx, "udp", "infra-dns:53") - if err == nil { - return conn, nil - } - // Fallback to system DNS - return d.DialContext(ctx, network, address) - }, -} - // domainCheck performs a DNS lookup to check if a domain resolves func (c *Crawler) domainCheck(host string) error { - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() - _, err := dnsResolver.LookupHost(ctx, host) + _, err := net.DefaultResolver.LookupHost(ctx, host) return err }