aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index af00591..ca024a9 100644
--- a/main.go
+++ b/main.go
@@ -45,7 +45,10 @@ func main() {
}
func printErr(ip net.IP, rrtype string, err error) {
- if !strings.Contains(err.Error(), "no such host") {
+ // the error types here are awful and this feels like it might
+ // accidentally catch some non-NXDOMAIN errors
+ if !strings.HasSuffix(err.Error(), "no such host") &&
+ !strings.HasSuffix(err.Error(), "nodename nor servname provided, or not known") {
fmt.Fprintf(os.Stderr, "%s\t# %s error: %s\n", ip, rrtype, err)
}
}