extended the zonefile to also include the dns entries of the alternative domains

added the dmarc report dns entry also for the main domain
This commit is contained in:
Jumper78
2025-02-14 22:00:56 +00:00
parent 5f4d428b2a
commit aea7680848

View File

@@ -81,8 +81,18 @@ def domain_download_zonefile(domain_name):
txt = ' '.join(f'"{txt[p:p+250]}"' for p in range(0, len(txt), 250))
res.append(f'{record} {txt}')
res.append(domain.dns_dmarc)
res.append(domain.dns_dmarc_report)
res.extend(domain.dns_tlsa)
res.extend(domain.dns_autoconfig)
for alternative in domain.alternatives:
res.extend([alternative.dns_mx, alternative.dns_spf])
if alternative.domain.dkim_publickey:
record = alternative.dns_dkim.split('"', 1)[0].strip()
txt = f'v=DKIM1; k=rsa; p={alternative.domain.dkim_publickey}'
txt = ' '.join(f'"{txt[p:p+250]}"' for p in range(0, len(txt), 250))
res.append(f'{record} {txt}')
res.append(alternative.dns_dmarc)
res.append(alternative.dns_dmarc_report)
res.append("")
return flask.Response(
"\n".join(res),