detect blocks that self-redirect

This commit is contained in:
Connor Olding 2021-08-06 14:22:27 -07:00
parent 5804ad6145
commit 1395e7d6f6

View file

@ -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"