diff --git a/acme/dns_challenge.go b/acme/dns_challenge.go index 83fc45be..95629ff3 100644 --- a/acme/dns_challenge.go +++ b/acme/dns_challenge.go @@ -73,7 +73,7 @@ func checkDNS(domain, fqdn string) bool { m := new(dns.Msg) m.SetQuestion(domain+".", dns.TypeSOA) c := new(dns.Client) - in, _, err := c.Exchange(m, "8.8.8.8:53") + in, _, err := c.Exchange(m, "google-public-dns-a.google.com:53") if err != nil { return false } diff --git a/acme/dns_challenge_test.go b/acme/dns_challenge_test.go index 3137f2e2..0af40f71 100644 --- a/acme/dns_challenge_test.go +++ b/acme/dns_challenge_test.go @@ -37,3 +37,9 @@ func TestDNSValidServerResponse(t *testing.T) { t.Errorf("VALID: Expected Solve to return no error but the error was -> %v", err) } } + +func TestPreCheckDNS(t *testing.T) { + if !preCheckDNS("api.letsencrypt.org", "acme-staging.api.letsencrypt.org") { + t.Errorf("preCheckDNS failed for acme-staging.api.letsencrypt.org") + } +}