Switch back to infra-dns for DNS lookups

infra-dns now configured with Charter DNS servers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-02-02 21:02:28 -05:00
parent e6761954c0
commit 07621a7059
+10 -1
View File
@@ -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
}