SPF验证报 PermError 'too many DNS lookups',什么意思?怎么修复?
77
SPF验证报 PermError "too many DNS lookups",什么意思?怎么修复?
▼
根因
RFC 7208 §4.6.4 规定:SPF 每封邮件的 DNS 查询不得超过 10 次(包括 include / a / mx / ptr / exists / redirect 引发的递归查询)。超过即返回 PermError(永久错误),等同于 SPF 未通过。
为什么会超
典型场景:域名用了多个第三方发信服务,v=spf1 include:spf1.com include:spf2.com include:spf3.com ... ~all
每个 include 消耗 ≥1 次 DNS 查询,多层嵌套的 include(include 里又有 include)累积很容易超 10。
修复方法
1. 裁剪无用 include:只保留确实在用的服务,删除已停用的
2. 合并为 IP:把低频变更的 include 手动解析为 ip4/ip6 引用
3. 展平(Flatten):用自动化工具(如 dmarcian SPF Flattener、AutoSPF)把嵌套 include 递归展开成扁平 IP 列表
4. 子域名隔离:不同服务的发信用不同子域名,各子域名配自己的短 SPF
在线检测:mxtoolbox.com/spf.aspx 或 dmarcian.com/spf-survey/
参考:RFC 7208 §4.6.4 DNS Lookup Limits · DMARCLY Safe SPF · MxToolbox SPF Checker
