在dmarc.org ,建议将 DNS 的 IN TXT 记录以特殊形式写入区域文件中,以免它们在文本编辑器中溢出行。
The DMARC policy record might look like this when retrieved using a common command-line tool:
% dig +short TXT _dmarc.example.com. "v=DMARC1\; p=none\; rua=mailto:dmarc-feedback@example.com"
To publish such a record, the DNS administrator for the Domain Owner creates an entry like the following in the appropriate zone file (following the conventional zone file format):
; DMARC record for the domain example.com _dmarc IN TXT ( "v=DMARC1; p=none; " "rua=mailto:dmarc-feedback@example.com" )
我已经尝试按照我的实际区域文件中的示例使用 NSD;然而,当我随后查询域时,我实际上也得到了包含在多行中的结果。
% dig +short TXT _dmarc.example.su
"v=DMARC1\; " "p=reject\; " "rua=mailto:rua-dmarc@example.su"
这是预期的吗?这是否可能会破坏某些本应解析这些 TXT 记录以获取 DMARC/SPF/DKIM 等的软件?
最佳答案
TXT
的各个组件每个记录最多只能包含 255 个字符,因为它们是在 <length><data ...>
中通过网络传输的格式。
任何可能需要超过 255 个字符的代码都应该能够将多个组件合并到一个字符数组中。
在主文件格式中,字符串周围的大括号表示多个组件将包含在单个 TXT 记录中 - 如果没有它们,这将创建两个单独的 TXT 记录,并且两个记录的相对顺序将是未定义的和主题改变。
https://stackoverflow.com/questions/29311071/