mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
DNS: Also check A and CNAME entries
This commit is contained in:
@@ -169,6 +169,12 @@ def dns_cmd(args, out):
|
||||
dkim_entry=dkim_entry,
|
||||
ipv6=ipv6,
|
||||
).strip()
|
||||
for typ in ["A", "AAAA", "CNAME", "CAA"]:
|
||||
if f" {typ} " in line:
|
||||
domain, value = line.split(f" {typ} ")
|
||||
current = dns.get(typ, domain.strip()[:-1])
|
||||
if current != value:
|
||||
to_print.append(line)
|
||||
if " MX " in line:
|
||||
domain, typ, prio, value = line.split()
|
||||
current = dns.resolve_mx(domain[:-1])
|
||||
@@ -181,16 +187,6 @@ def dns_cmd(args, out):
|
||||
current = dns.get("SRV", domain[:-1])
|
||||
if current != f"{prio} {weight} {port} {value}":
|
||||
to_print.append(line)
|
||||
if " AAAA " in line:
|
||||
domain, value = line.split(" AAAA ")
|
||||
current = dns.get("AAAA", domain.strip()[:-1])
|
||||
if current != value:
|
||||
to_print.append(line)
|
||||
if " CAA " in line:
|
||||
domain, value = line.split(" IN CAA ")
|
||||
current = dns.get("CAA", domain.strip()[:-1])
|
||||
if current != value:
|
||||
to_print.append(line)
|
||||
if " TXT " in line:
|
||||
domain, value = line.split(" TXT ")
|
||||
current = dns.get("TXT", domain.strip()[:-1])
|
||||
|
||||
Reference in New Issue
Block a user