SPF Returned PermError Due to DNS Limit: How to Count 10 Checks Before Changing the Record
PermError does not always indicate the eleventh DNS-dependent term. First, separate the limit from syntax and multiple SPF records, then expand includes and count the reachable path.

In this article
PermError не доказывает, что SPF дошёл до одиннадцатого DNS-зависимого термина. Под «DNS-проверками» в заголовке понимаются термины SPF, вызывающие DNS-запросы, а не число DNS-пакетов. Сначала определите домен, который приёмник проверял по MAIL FROM или HELO, сохраните его TXT-записи и точный диагностический ответ. Если выбрана одна синтаксически корректная SPF-запись, раскройте include и redirect и посчитайте достижимый путь: глобальный предел для DNS-зависимых терминов — десять.
Раздел 4.5 RFC 7208 указывает: каждое из двух условий уже даёт PermError — более одной подходящей записи v=spf1 либо синтаксическая ошибка. Поэтому счёт десяти — не первый и не единственный диагноз.
Почему длина строки ничего не доказывает
SPF проверяет, разрешён ли отправляющий узел для домена технического отправителя MAIL FROM или HELO. Видимый адрес From может относиться к другому домену. Поэтому успешный SPF ещё не обещает прохождение DMARC, а ошибка SPF не исправляется косметической заменой видимого адреса.
Механизм include запускает рекурсивную оценку SPF другой зоны. Поставщик может изменить свою вложенную запись, хотя TXT в вашей зоне останется прежним. Вот тут интересно: строка выглядит такой же, а число DNS-зависимых терминов на достижимом пути уже другое.
Что входит в лимит десяти
Раздел 4.6.4 RFC 7208 относит к DNS-зависимым терминам include, a, mx, ptr, exists и redirect. Их общий предел при оценке — десять. При превышении реализация должна вернуть permerror.
- В общий счёт входят вложенные include: рекурсия не обнуляет счётчик.
- Механизмы all, ip4 и ip6 и модификатор exp не расходуют этот лимит во время основной оценки.
- Для mx и ptr действуют дополнительные ограничения на адресные запросы. Сам ptr RFC прямо помечает как нежелательный для использования.
- Пустые ответы и NXDOMAIN образуют отдельные void lookups: RFC рекомендует ограничивать их двумя, а превышение также приводит к permerror.
Учебный расчёт: как незаметно получить одиннадцать
Допустим, домен магазина использует два внешних сервиса и собственные MX. Все имена ниже относятся к зарезервированной зоне .example и не описывают реального оператора.
v=spf1 include:_spf.mail-a.example include:_spf.crm.example mx -all
На рассматриваемом пути первый механизм include раскрывает ещё три вложенных механизма include, а второй — четыре вложенных механизма include и один механизм a. Если ни одна ранняя ветвь не дала совпадения, оценка доходит до mx в корневой записи. В этой учебной модели каждый предыдущий include завершается результатом, при котором оценка внешней записи продолжается; PermError и TempError внутри include не моделируются.
Этап | DNS-зависимые термины | Суммарное число терминов |
|---|---|---|
Корневой include mail-a | 1 include + 3 вложенных include | 4 |
Корневой include crm | 1 include + 4 вложенных include + 1 a | 10 |
Корневой mx | 1 mx | 11 → PermError |
Это консервативный разбор пути, на котором предыдущие механизмы не дали совпадения. SPF оценивается слева направо и может остановиться раньше при совпадении, поэтому проверка одного письма с одного IP не доказывает безопасность всех маршрутов. Для изменения нужно знать, какие сервисы действительно отправляют от имени домена и какие ветви могут быть пройдены.
Безопасный порядок до изменения DNS
- Составьте список действующих отправителей: сайт, корпоративная почта, CRM, рассылки, касса, поддержка и внешние формы. Для каждого зафиксируйте домен MAIL FROM и владельца настройки.
- Сохраните текущую SPF-запись и время снимка. У домена должна быть одна выбранная SPF-запись; создание второй не разгружает первую и само создаёт ошибку выбора политики.
- Раскройте каждый include и redirect по текущим авторитетным DNS-ответам. Постройте дерево, а не просто посчитайте слова в корневой строке.
- Отдельно отметьте include, a, mx, ptr, exists и redirect. Посчитайте возможные пути до совпадения или завершающего all; для спорного маршрута берите худший достижимый путь.
- Удаляйте источник только после подтверждения, что он больше не отправляет. Автоматическое уплощение include в набор IP переносит на владельца домена обязанность следить за изменениями адресов поставщика и не является универсальным исправлением.
- Согласуйте одну минимальную правку, сохраните прежнее значение и условие отката. Не меняйте -all на ~all ради сокрытия PermError: квалификатор завершения решает другой вопрос.
- После распространения DNS отправьте контрольные письма через каждый реальный сервис. В заголовке Authentication-Results проверьте итог SPF, домен проверки и отдельно согласование домена для DMARC.
TXT-ответ каждого имени можно сохранить через DIG-инструмент, но он не строит рекурсивный SPF-граф и не считает лимит автоматически.
SPF Pass и DMARC Pass — не одно и то же
По RFC 9989 DMARC учитывает результат SPF для домена MAIL FROM, но не результат SPF, полученный при проверке идентификатора HELO. Домен MAIL FROM должен быть согласован с доменом автора в поле заголовка письма From: полное совпадение при строгом согласовании (strict alignment) или общий организационный домен при ослабленном согласовании (relaxed alignment). Поэтому после исправления ошибки превышения DNS-лимита нужно проверить не только spf=pass, но и домен, для которого он получен.
Общий маршрут письма и различие SPF, DKIM и DMARC разобраны в материале «Путь письма о заказе от магазина до входящих». После изменения отправьте письмо тем же сервисом и проверьте его через инструмент «Тест письма на спам»: результат относится к фактически полученному сообщению, а не ко всем будущим маршрутам.
Что считать готовым результатом
- Есть один актуальный SPF TXT и сохранено прежнее значение для отката.
- Дерево include и redirect построено по текущим ответам с датой проверки.
- На каждом достижимом пути не больше десяти DNS-зависимых терминов; отдельно учтены пустые ответы.
- Каждый реальный сервис отправил контрольное письмо, в котором нет SPF PermError.
- Для видимого домена отдельно подтверждено согласование DMARC либо понятно, какой путь через DKIM его обеспечивает.
Правила и ссылки проверены 14 ноября 2026 года. Сам лимит описывает нагрузку DNS во время оценки SPF, а не репутацию домена и не гарантию попадания во входящие.
PermError does not prove that SPF reached the eleventh DNS-dependent term. By "DNS checks" in the title, we mean SPF terms that trigger DNS queries, not the number of DNS packets. First, identify the domain the receiver checked via MAIL FROM or HELO, save its TXT records and the exact diagnostic response. If a single syntactically correct SPF record is selected, expand includes and redirects and count the reachable path: the global limit for DNS-dependent terms is ten.
Section 4.5 RFC 7208 states: either of the two conditions already yields PermError — more than one suitable record v=spf1 or a syntax error. Therefore, the count of ten is neither the first nor the only diagnosis.
Why String Length Proves Nothing
SPF checks whether the sending node is authorized for the technical sender's domain in MAIL FROM or HELO. The visible From address may belong to a different domain. Therefore, a successful SPF does not guarantee passing DMARC, and an SPF error cannot be fixed by cosmetically changing the visible address.
The include mechanism triggers a recursive evaluation of SPF for another zone. A provider can change their nested record while the TXT record in your zone remains unchanged. Here is the interesting part: the string looks identical, but the number of DNS-dependent terms on the reachable path has already changed.
What counts toward the limit of ten
Section 4.6.4 RFC 7208 classifies include, a, mx, ptr, exists, and redirect as DNS-dependent terms. Their combined limit during evaluation is ten. If this limit is exceeded, the implementation must return permerror.
- The total count includes nested includes: recursion does not reset the counter.
- The all, ip4, and ip6 mechanisms, along with the exp modifier, do not consume this limit during the primary evaluation.
- Additional restrictions apply to address queries for mx and ptr. The RFC explicitly marks ptr as undesirable for use.
- Empty responses and NXDOMAIN form separate void lookups: the RFC recommends limiting these to two, and exceeding this also results in a permerror.
Training calculation: how to silently reach eleven
Assume a store domain uses two external services and its own MX records. All names below refer to the reserved .example zone and do not describe a real operator.
v=spf1 include:_spf.mail-a.example include:_spf.crm.example mx -all
On the path under consideration, the first mechanism include reveals three additional nested mechanisms include, while the second reveals four nested mechanisms include and one mechanism a. If no early branch yields a match, evaluation proceeds to mx in the root record. In this educational model, each preceding include concludes with a result where evaluation of the outer record continues; PermError and TempError within include are not modeled.
Stage | DNS-dependent terms | Total number of terms |
|---|---|---|
Root include mail-a | 1 include + 3 nested includes | 4 |
Root include crm | 1 include + 4 nested includes + 1 a | 10 |
Root mx | 1 mx | 11 → PermError |
This is a conservative path analysis where previous mechanisms yielded no match. SPF is evaluated left to right and may stop early upon a match, so checking a single email from one IP does not prove the safety of all routes. To make changes, you must know which services actually send on behalf of the domain and which branches can be traversed.
Safe order before changing DNS
- Compile a list of active senders: website, corporate email, CRM, mailing lists, POS system, support, and external forms. For each, record the MAIL FROM domain and the configuration owner.
- Save the current SPF record and the snapshot timestamp. A domain must have exactly one selected SPF record; creating a second one does not offload the first and instead creates a policy selection error.
- Expand each include and redirect based on current authoritative DNS responses. Build a tree, not just a word count of the root string.
- Separately mark include, a, mx, ptr, exists, and redirect. Count all possible paths to a match or the terminating 'all'; for an ambiguous route, take the worst-case reachable path.
- Remove a source only after confirming it no longer sends. Automatically flattening 'include' into a set of IPs shifts the responsibility for tracking provider address changes to the domain owner and is not a universal fix.
- Agree on a single minimal change, preserve the previous value, and define a rollback condition. Do not change '-all' to '~all' to hide a PermError: the qualifier at the end resolves a different issue.
- After DNS propagation, send test emails through each real service. In the Authentication-Results header, verify the SPF result, the check domain, and the domain alignment for DMARC separately.
The TXT response for each name can be saved via the DIG tool, but it does not build a recursive SPF graph and does not count the limit automatically.
SPF Pass and DMARC Pass are not the same thing
According to RFC 9989, DMARC considers the SPF result for the domain MAIL FROM, but not the SPF result obtained when checking the identifier HELO. The domain MAIL FROM must align with the author domain in the email header field From: exact match for strict alignment or a shared organizational domain for relaxed alignment. Therefore, after fixing the DNS limit exceeded error, you must check not only spf=pass but also the domain for which it was obtained.
The general email routing and the differences between SPF, DKIM, and DMARC are covered in the article «The path of an order email from the store to the inbox». After making changes, send a test email using the same service and check it with the «Email Spam Test» tool: the result applies to the actually received message, not to all future routing paths.
What counts as a completed result
- There is one current SPF TXT record, and the previous value has been saved for rollback.
- The include and redirect tree is built based on current responses with the verification date.
- No reachable path contains more than ten DNS-dependent terms; empty responses are accounted for separately.
- Each actual service sent a test email that contains no SPF PermError.
- For the visible domain, DMARC alignment has been separately confirmed, or it is clear which DKIM path provides it.
Rules and links were verified on November 14, 2026. The limit itself describes DNS load during SPF evaluation, not domain reputation or a guarantee of delivery to the inbox.





Discussion 0
Share your experience and ask questions. Comments without links appear after editorial review.
No comments yet. Start the discussion.