From 07621a7059f322f58165962a9d4057cd54a0a6c7 Mon Sep 17 00:00:00 2001 From: primal Date: Mon, 2 Feb 2026 21:02:28 -0500 Subject: [PATCH] Switch back to infra-dns for DNS lookups infra-dns now configured with Charter DNS servers. Co-Authored-By: Claude Opus 4.5 --- crawler.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crawler.go b/crawler.go index 4233537..9ba4274 100644 --- a/crawler.go +++ b/crawler.go @@ -145,11 +145,20 @@ func (c *Crawler) StartMaintenanceLoop() { } } +// dnsResolver uses local caching DNS (infra-dns) +var dnsResolver = &net.Resolver{ + PreferGo: true, + Dial: func(ctx context.Context, network, address string) (net.Conn, error) { + d := net.Dialer{Timeout: 5 * time.Second} + return d.DialContext(ctx, "udp", "infra-dns:53") + }, +} + // domainCheck performs a DNS lookup to check if a domain resolves func (c *Crawler) domainCheck(host string) error { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() - _, err := net.DefaultResolver.LookupHost(ctx, host) + _, err := dnsResolver.LookupHost(ctx, host) return err }