diff --git a/respodns/dns.py b/respodns/dns.py index 7ac4dd2..1b04006 100644 --- a/respodns/dns.py +++ b/respodns/dns.py @@ -71,6 +71,11 @@ def process_result(res, ip, check, opts: Options): elif check.kind.startswith("bad"): reason = "okay" if "NXDOMAIN" in res else "redirect" + elif any(r == ip for r in res): + # server returned its own IP, must be a block, unless + # one of our checks actually contains a domain that also hosts a DNS. + reason = "block" + elif any(is_bogon(r) or is_block_target(r) for r in res): reason = "block"