Add a more descriptive FindZoneByFqdn error message

Spent a couple of days tracking down bad `SERVFAIL` for some of our
domains, and had a hard time finding where this was coming from. Make
the error slightly more descriptive to help locate it, and more inline
with the terminal error of the function.

Signed-off-by: clatour <chandler.latour@gmail.com>
This commit is contained in:
clatour 2021-04-20 22:06:24 +00:00
parent 17bf228fbb
commit 2c2fbd483b

View File

@ -342,7 +342,7 @@ func FindZoneByFqdn(fqdn string, nameservers []string) (string, error) {
// Any response code other than NOERROR and NXDOMAIN is treated as error
if in.Rcode != dns.RcodeNameError && in.Rcode != dns.RcodeSuccess {
return "", fmt.Errorf("Unexpected response code '%s' for %s",
return "", fmt.Errorf("Could not find the start of authority, unexpected response code '%s' for %s",
dns.RcodeToString[in.Rcode], domain)
}