DMARC Engine
Home/Blog/DNS TXT Record Fragmentation: Mitigating Email Authentication Issues
Blog

DNS TXT Record Fragmentation: Mitigating Email Authentication Issues

DNS TXT record fragmentation can lead to email authentication issues, mitigate by keeping records short and using multiple records when necessary

21 November 2026 · DMARC Engine · 10 min read

DNS TXT Record Fragmentation: Mitigating Email Authentication Issues
Key takeaways
  • Keep DNS TXT records under 255 characters
  • Use multiple records instead of fragmenting one
  • Ensure proper formatting and concatenation
  • Verify receiver handling of fragmented records

Introduction to DNS TXT Record Fragmentation Issues

A common pattern is for organisations to publish multiple DNS TXT records for email authentication, such as DMARC, SPF, and DKIM.

When these records exceed the 255-character limit, they must be fragmented to prevent authentication issues.

For example, a DMARC record may be fragmented into multiple records, like so:

DNS record
_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:dmarc@example.com"
_dmarc.example.com. IN TXT "rua=mailto:dmarc2@example.com; ruf=mailto:dmarc3@example.com"

This can lead to issues with email authentication, particularly if the records are not properly formatted or if receivers do not handle fragmented records correctly.

In hosted or managed setups, the provider may handle record fragmentation automatically, but it is still important for organisations to understand how to mitigate potential issues.

DNS record
_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:dmarc@example.com; fo=1"

should be split into two records, to prevent potential issues with receivers that do not handle long records correctly.


> Warning: receivers typically handle fragmented records by concatenating them, but may reject emails if the records are not properly formatted.

Understanding the 255-Character Limit and Its Impact

The 255-character limit for DNS TXT records can significantly impact email authentication, particularly for organisations with complex domain configurations. Receivers typically enforce this limit, which can lead to truncated records and subsequent authentication issues. A common pattern is for organisations to publish multiple DNS TXT records for a single domain, each containing a portion of the required email authentication configuration.

DNS record
"v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com; ruf=mailto:forensics@example.com; fo=1"


This example DMARC record is well within the 255-character limit. However, more complex configurations, such as those including multiple reporting URIs or detailed policy settings, can easily exceed this limit. In hosted or managed setups, the DNS provider may automatically handle record fragmentation, but it is crucial to verify this behaviour to avoid potential issues.

DNS record
"v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com, mailto:aggrep2@example.com,"
"rua=mailto:aggrep3@example.com; ruf=mailto:forensics@example.com; fo=1"


In this example, the DMARC record has been fragmented across two DNS TXT records. This approach requires careful management to ensure that all required configuration elements are included and correctly ordered.


Warning: when fragmenting DNS TXT records, organisations must ensure that each record is correctly formatted and that the overall configuration is valid, as receivers will typically reject malformed or incomplete records.

Practical Examples of Fragmented DNS TXT Records

A common pattern is for organisations to publish multiple DNS TXT records for the same domain, often due to the 255-character limit imposed by some DNS providers. For instance, a domain may have separate records for DMARC, SPF, and DKIM. The aggregate reports will show authentication issues if these records are not properly formatted.

DNS record
_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com; ruf=mailto:forep@example.com; fo=1"

In this example, the DMARC record is within the character limit, but if additional tags are required, the record may need to be fragmented. Receivers typically handle fragmented records by concatenating them, but this can lead to issues if the records are not properly formatted.

DNS record
example.com. IN TXT "v=spf1 include:_spf.example.com "
example.com. IN TXT "ip4:192.0.2.1 ip4:192.0.2.2 -all"

In a hosted or managed setup, the provider may automatically handle record fragmentation, but it is still important to ensure that the records are properly formatted to avoid authentication issues.

DNS record
selector._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwV"
selector._domainkey.example.com. IN TXT "d0R0ABXKwSQP9P5rRVRjY5iH3X4RtFf50MQPLK9JqQHvKbTLY+ZQQ4H9K3"

Warning: If the records are not properly concatenated, it can lead to authentication failures, resulting in emails being rejected or quarantined by receivers.


To mitigate these issues, it is essential to carefully plan and manage DNS TXT record fragmentation, taking into account the character limit and the specific requirements of each record type. This includes ensuring that the records are properly formatted and concatenated to avoid authentication issues.

Mitigating Email Authentication Issues with Record Fragmentation

When dealing with DNS TXT record fragmentation, it is crucial to consider the impact on email authentication. A common pattern is for receivers to reject emails if the DMARC record is fragmented, as this can lead to issues with record parsing. For instance, if a DMARC record is split into multiple strings, the receiver may not be able to correctly interpret the record, resulting in authentication failures.

DNS record
"v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com;
 ruf=mailto:forensicp@example.com; fo=1"

becomes fragmented into two strings:

DNS record
"v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com;"
"ruf=mailto:forensicp@example.com; fo=1"

This can cause issues with email authentication, as the receiver may not be able to correctly parse the record.

A hosted or managed setup may handle this issue by automatically concatenating the fragmented records, but it is still important to ensure that the records are correctly formatted to avoid any potential issues. Receivers typically expect the DMARC record to be in a specific format, and any deviations from this format can lead to authentication failures.

To mitigate email authentication issues with record fragmentation, it is recommended to keep DNS TXT records as short as possible, ideally under 255 characters. If a record needs to be longer than this, it is better to use multiple records rather than fragmenting a single record. For example, instead of fragmenting a single DMARC record, you could use multiple records, each with a specific function:

DNS record
"v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com;"
DNS record
"v=DMARC1; ruf=mailto:forensicp@example.com; fo=1"

However, this approach requires careful planning to ensure that the records are correctly formatted and do not cause any issues with email authentication.


Warning: when using multiple records, it is essential to ensure that each record is correctly formatted and does not overlap with other records, as this can cause issues with email authentication.


Lists of potential issues to consider when mitigating email authentication issues with record fragmentation include:

  • record parsing errors
  • authentication failures
  • issues with receiver interpretation of the records


To avoid these issues, it is crucial to carefully plan and implement DNS TXT records, taking into account the potential for record fragmentation and its impact on email authentication. By keeping records short and using multiple records when necessary, you can help ensure that your email authentication setup is correct and functional.

Operational Guidance for Implementing Fragmented Records

When implementing fragmented DNS TXT records, it is crucial to understand the limitations and potential issues that may arise. A common pattern is for administrators to split long records into multiple fragments, each containing a portion of the original record. For instance, a DMARC record may be fragmented into two or more parts, each containing a subset of the DMARC policy and alignment settings.

The aggregate reports will show issues related to record fragmentation, such as authentication failures due to incomplete or malformed records. Receivers typically handle fragmented records by concatenating the fragments and then processing the resulting record. However, this process can be error-prone, and small mistakes can lead to authentication issues.

To mitigate these issues, it is recommended to keep each fragment as short as possible while still conveying the necessary information. A hosted or managed setup may handle record fragmentation differently, so it is essential to consult the provider's documentation for specific guidance.

DNS record
"v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com; 
 ruf=mailto:forep@example.com; fo=1"

can be fragmented into two parts:

DNS record
"v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com;"

and

DNS record
"ruf=mailto:forep@example.com; fo=1"

However, the order of the fragments is critical, as receivers will typically concatenate the fragments in the order they appear in the DNS response.

DNS record
"ruf=mailto:forep@example.com; fo=1; v=DMARC1; p=none; pct=100; 
rua=mailto:aggrep@example.com;"

is not equivalent to the original record, as the v tag is not at the beginning of the record.


A list of best practices for implementing fragmented records includes:

* Keeping each fragment as short as possible
* Ensuring the order of the fragments is correct
* Testing the fragmented records thoroughly to ensure they are correctly concatenated and processed by receivers
* Using a consistent naming convention for the fragments to avoid confusion

Python
import dns.resolver

def test_fragmented_record(domain, record_name):
 answers = dns.resolver.resolve(domain, record_name)
 for answer in answers:
 print(answer.to_text())

can be used to test the fragmented records and verify they are correctly concatenated.


Warning: Implementing fragmented DNS TXT records can be complex and error-prone. It is essential to carefully test and validate the records to ensure they are correctly processed by receivers and do not cause authentication issues.

When dealing with DNS TXT record fragmentation, analysing aggregate reports is crucial to identify potential issues. The aggregate reports will show authentication failures due to fragmented records, which can be challenging to diagnose. A common pattern is that receivers typically report authentication failures with a specific error code, such as spf_permerror or dkim_sig_verify_failed, indicating a problem with the DNS records.

DNS record
"v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com; ruf=mailto:forep@example.com; fo=1"

In this example, the rua tag specifies the email address where aggregate reports will be sent. These reports will contain information about authentication failures, including those caused by fragmented DNS TXT records.

A hosted or managed setup may handle this differently, with some providers offering customised reporting and analytics tools to help identify and mitigate fragmentation-related issues. However, it is essential to understand how to analyse these reports manually to ensure effective troubleshooting.

When analysing aggregate reports, look for error codes and messages that indicate DNS record fragmentation issues. For instance, if the report shows a high number of spf_permerror errors, it may indicate that the SPF record is fragmented, causing authentication failures.

Python
import xml.etree.ElementTree as ET

# Parse the aggregate report XML
root = ET.parse('aggrep.xml').getroot()

# Extract error codes and messages
for error in root.findall('.//error'):
 print(error.text)

This code snippet demonstrates how to parse an aggregate report XML file and extract error codes and messages, which can help identify fragmentation-related issues.


Tip: When analysing aggregate reports, it is essential to consider the reporting period and the volume of emails sent during that time. This will help you understand the scope of the issue and prioritize mitigation efforts.

Best Practices for Managing DNS TXT Record Fragmentation

To mitigate email authentication issues caused by DNS TXT record fragmentation, it is essential to manage records effectively. A common pattern is to publish multiple records for the same domain, each containing a portion of the authentication data. For example, a domain may have multiple SPF records, each with a different set of IP addresses or include statements.

DNS record
"v=spf1 include:_spf.example.com ip4:192.0.2.1 -all"
"v=spf1 include:_spf2.example.com ip4:198.51.100.1 -all"

In a hosted or managed setup, the provider may handle record fragmentation automatically, but it is still crucial to understand the underlying mechanics. When publishing DNS records, it is recommended to use a consistent naming convention and to keep records as short as possible to avoid fragmentation.

  • Use a single record for each type of authentication data, if possible
  • Keep records under 255 characters to avoid fragmentation
  • Use include statements to reference other records, rather than duplicating data
DNS record
"v=spf1 include:_spf.example.com include:_spf2.example.com -all"

Tip: When analysing aggregate reports, look for signs of record fragmentation, such as authentication failures due to truncated records. This can help identify issues with record length or formatting. By following these best practices and being mindful of record fragmentation, email authentication issues can be minimised, and deliverability improved.

Check your own domain

Share

See where your domain stands today

Run a free DMARC scan, then let us take you to enforced p=reject with no email outage.