DMARC Engine
Home/Blog/DMARC Alignment for Domains with Mixed IPv4 and IPv6 Mail Infrastructure
Blog

DMARC Alignment for Domains with Mixed IPv4 and IPv6 Mail Infrastructure

Achieving DMARC alignment is challenging in dual-stacked environments, this article provides solutions for domains with mixed IPv4 and IPv6 mail infrastructure

27 July 2026 · DMARC Engine · 37 min read

DMARC Alignment for Domains with Mixed IPv4 and IPv6 Mail Infrastructure

Introduction to DMARC Alignment Challenges in Dual-Stacked Environments

When managing DMARC for domains with mixed IPv4 and IPv6 mail infrastructure, one of the most significant hurdles is achieving and maintaining alignment. This challenge is particularly pronounced in dual-stacked environments, where mail servers support both IPv4 and IPv6 protocols. The centre of the issue is ensuring that the domain's DMARC policy is correctly applied, regardless of whether the mail is sent over IPv4 or IPv6.

For instance, consider a scenario where a domain, example.com, has a mail server that is configured to send emails via both IPv4 and IPv6. The domain's DMARC record might look something like this:

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

In this example, the DMARC policy is set to monitor mode (p=none), which means it will not block any emails but will send aggregate reports to the specified email address. However, when it comes to SPF alignment, things can get complicated. If the domain has an SPF record that includes both IPv4 and IPv6 addresses, such as:

example.com. IN TXT "v=spf1 ip4:192.0.2.1 ip6:2001:db8::1 -all"

The mail server's IPv6 address (2001:db8::1) must be included in the SPF record to maintain alignment when sending emails over IPv6. Failure to do so can result in SPF authentication failures, which in turn can cause DMARC failures, even if the domain and mail server identities match.

In a hosted or managed setup, such as the one provided by DMARC Engine, the process of managing these records and ensuring alignment is simplified through automated tools and expert oversight. For example, our system can automatically generate and update SPF records to include both IPv4 and IPv6 addresses of the mail servers, thus reducing the risk of misconfiguration. However, for organisations managing their DMARC and mail infrastructure in-house, careful planning and regular audits are necessary to avoid alignment issues.

A common mistake in dual-stacked environments is not accounting for the colour of the IP addresses in the SPF record. For IPv6, the address should be enclosed in square brackets to distinguish it from the IPv4 address, like so:

example.com. IN TXT "v=spf1 ip4:192.0.2.1 ip6:[2001:db8::1] -all"

This distinction is crucial for SPF resolvers to correctly interpret the record and validate the sending IP address against the domain's policy.

In addition to SPF alignment, DKIM alignment also poses challenges in mixed environments. DKIM involves cryptographic signatures that verify the authenticity of the email content. However, if a domain uses multiple mail servers with different selectors (e.g., selector1 and selector2), each with its own public key published in DNS, managing these keys and ensuring they are correctly aligned with the DMARC policy can be complex.

For domains transitioning to IPv6, or those already operating in dual-stacked environments, optimising DMARC alignment requires a deep understanding of both SPF and DKIM configurations, as well as the capabilities and limitations of the mail servers involved. Regular monitoring of aggregate reports (RUA) is essential for identifying and addressing alignment issues before they lead to delivery problems.

In our experience at DMARC Engine, where we manage DMARC, SPF, DKIM, MTA-STS, and BIMI for numerous customers, the key to successful DMARC deployment in complex, dual-stacked environments is a combination of meticulous record management, ongoing monitoring, and a proactive approach to addressing potential alignment issues. By understanding the intricacies of SPF and DKIM in mixed IPv4 and IPv6 scenarios and leveraging tools and expertise to manage these complexities, organisations can effectively optimise their DMARC alignment and protect their domains from spoofing and phishing attacks.

Understanding SPF Alignment in Mixed IPv4 and IPv6 Scenarios

When dealing with domains that have mixed IPv4 and IPv6 mail infrastructure, one of the key challenges is ensuring proper SPF alignment. This is crucial because SPF alignment is a critical component of DMARC, and any misalignment can lead to failed DMARC checks, resulting in emails being blocked or flagged as spam. In a mixed environment, the complexity arises from the need to manage both IPv4 and IPv6 addresses in the SPF record, ensuring that all mail servers, regardless of the IP version they use, are properly included and aligned.

To start with, it's essential to understand how SPF works in a dual-stacked setup. SPF, or Sender Policy Framework, is a protocol that allows domain owners to specify which IP addresses are authorised to send emails on their behalf. This is done through an SPF record, which is a TXT record published in the domain's DNS. For example, a simple SPF record might look like this:

"v=spf1 ip4:192.0.2.1 ip6:2001:db8::1 -all"

This record specifies that the IPv4 address 192.0.2.1 and the IPv6 address 2001:db8::1 are authorised to send emails for the domain. The -all at the end indicates that any other IP address not listed should be rejected.

However, in a mixed IPv4 and IPv6 environment, managing SPF records can become more complicated. One of the common issues is ensuring that the SPF record includes all the necessary IP addresses for both protocols. For instance, if a domain has multiple mail servers, some of which are hosted on IPv4 addresses and others on IPv6 addresses, the SPF record must include all these addresses to maintain alignment.

A practical approach to managing SPF in such scenarios is to use the include mechanism. This allows you to reference another domain's SPF record, which can be useful for including IP addresses from third-party services or subsidiary domains. For example:

"v=spf1 include:_spf.example.com ip4:192.0.2.1 ip6:2001:db8::1 -all"

Here, the SPF record includes all the IP addresses specified in the _spf.example.com record, in addition to the explicitly listed 192.0.2.1 and 2001:db8::1. This can help simplify the management of complex SPF setups, especially in hosted or managed environments where multiple services might be involved.

Another consideration in mixed environments is the use of CIDR notation to specify IP address ranges. This can be particularly useful for IPv6, where the address space is much larger, and listing individual addresses can become unwieldy. For example:

"v=spf1 ip6:2001:db8::/64 -all"

This record authorises any IPv6 address within the 2001:db8::/64 range to send emails for the domain. However, using CIDR notation requires careful planning to ensure that it does not inadvertently authorise unwanted IP addresses.

In a hosted or managed setup, such as what we offer at DMARC Engine, managing SPF alignment in mixed IPv4 and IPv6 scenarios is streamlined through automated tools and expert guidance. Our platform allows customers to easily manage their SPF records, including the addition of IPv4 and IPv6 addresses, and provides real-time feedback on alignment issues. This is particularly beneficial for domains with complex mail infrastructures, as it helps ensure that all mail servers are properly aligned, reducing the risk of DMARC failures.

Despite these tools and best practices, there are still edge cases and trade-offs to consider. For instance, in a scenario where a domain is transitioning from IPv4 to IPv6, the SPF record must be carefully updated to reflect the changing infrastructure. This might involve temporarily including both the old IPv4 addresses and the new IPv6 addresses in the SPF record, to ensure continuity of email service during the transition period.

On top of that, the limits on the size of SPF records and the number of includes that can be used must be carefully managed. DNS servers have limits on the size of records they can handle, and exceeding these limits can lead to SPF record truncation, causing alignment issues. Similarly, excessive use of includes can lead to SPF record processing errors, as the number of includes that can be recursively resolved is limited.

In conclusion to this section, managing SPF alignment in mixed IPv4 and IPv6 scenarios requires careful planning, precise management of SPF records, and an understanding of the complexities involved. By leveraging tools, best practices, and expert guidance, domains can ensure proper SPF alignment, even in the most complex environments, and thereby maintain the integrity of their email infrastructure and protect their brand reputation.

In real-world scenarios, we have seen domains successfully navigate these challenges by prioritising simplicity and clarity in their SPF records, regularly auditing their mail infrastructure to ensure alignment, and leveraging the capabilities of hosted and managed services to streamline SPF management. As the email landscape continues to evolve, with the increasing adoption of IPv6 and the complexities it introduces, the importance of properly managing SPF alignment will only continue to grow.

DKIM Alignment Considerations for Domains with Multiple Mail Servers

When managing domains with multiple mail servers in a mixed IPv4 and IPv6 environment, DKIM alignment can become a complex issue. DKIM, or DomainKeys Identified Mail, is a crucial component of DMARC, as it allows domains to assert responsibility for the messages they send by adding a digital signature to the headers of the email. For DKIM alignment to work correctly under DMARC, the domain name in the DKIM signature must match the domain name in the From header of the email. This is known as "relaxed" alignment, and it is the default mode for DMARC.

However, when a domain operates multiple mail servers, some of which may be using IPv4 and others IPv6, ensuring consistent DKIM signing and alignment can be challenging. Each mail server must be configured to sign emails with a DKIM key that aligns with the domain's DMARC policy. This means that if a domain has multiple mail servers, each server must have its own DKIM key, or they must share a key, and the domain's DMARC record must include all the relevant DKIM selectors.

For example, consider a domain example.com that has two mail servers, mail1.example.com and mail2.example.com, one using IPv4 and the other using IPv6. The domain's DMARC record might look something like this:

_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:aggrep@example.com; ruf=mailto:forensics@example.com; adkim=r; asp=f"

And the DKIM records for each mail server might look like this:

default._domainkey.mail1.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQAB"
default._domainkey.mail2.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQAB"

In this scenario, both mail servers are signing emails with the same DKIM key, but they have different selectors (default._domainkey.mail1.example.com and default._domainkey.mail2.example.com). This is not a problem, as long as the domain's DMARC record includes both selectors. However, if the DMARC record only includes one of the selectors, emails signed by the other mail server will fail DKIM alignment.

In a hosted or managed setup, such as the one provided by DMARC Engine, the complexity of managing multiple DKIM keys and selectors is handled automatically. The service will generate and rotate DKIM keys, and update the domain's DMARC record to include all the relevant selectors. This simplifies the process of ensuring DKIM alignment for domains with multiple mail servers.

One common issue that arises when configuring DKIM for multiple mail servers is the use of inconsistent DKIM selectors. For example, if one mail server is using a selector named default, and another mail server is using a selector named server1, the domain's DMARC record must include both selectors. If the DMARC record only includes one of the selectors, emails signed by the other mail server will fail DKIM alignment.

To avoid this issue, it is recommended to use a consistent naming convention for DKIM selectors across all mail servers. For example, a domain might use a selector named default for all mail servers, or use a selector named server1, server2, etc. for each mail server. The important thing is to ensure that the domain's DMARC record includes all the relevant selectors.

Another consideration when configuring DKIM for multiple mail servers is the use of key rotation. Key rotation is the process of periodically generating new DKIM keys and updating the domain's DKIM records to use the new keys. This is an important security practice, as it helps to prevent attackers from using a compromised DKIM key to send spoofed emails.

However, when a domain has multiple mail servers, key rotation can be complex. Each mail server must be configured to use the new DKIM key, and the domain's DMARC record must be updated to include the new key. If one mail server is not updated to use the new key, emails signed by that server will fail DKIM alignment.

To simplify key rotation, it is recommended to use a centralised key management system, such as the one provided by DMARC Engine. This allows administrators to generate and rotate DKIM keys, and update the domain's DKIM records and DMARC record, from a single interface.

In short, configuring DKIM for multiple mail servers in a mixed IPv4 and IPv6 environment requires careful planning and attention to detail. Administrators must ensure that each mail server is configured to sign emails with a DKIM key that aligns with the domain's DMARC policy, and that the domain's DMARC record includes all the relevant DKIM selectors. By using a consistent naming convention for DKIM selectors, and implementing a centralised key management system, administrators can simplify the process of ensuring DKIM alignment for domains with multiple mail servers.

The Impact of MTA-STS on DMARC Alignment in IPv6 Transitions

When organisations transition their mail infrastructure to support IPv6, alongside existing IPv4 setups, they often overlook the impact on DMARC alignment, particularly in relation to MTA-STS (Mail Transfer Agent Strict Transport Security). MTA-STS is a protocol that enables mail servers to declare their ability to support TLS encryption for email in transit, which is crucial for securing email communications. However, in mixed IPv4 and IPv6 environments, MTA-STS can introduce complexities that affect DMARC alignment if not properly managed.

A key consideration is how MTA-STS policies are published and retrieved by mail servers. The MTA-STS policy is typically published via a TXT record under the _mta-sts subdomain of the mail server's domain. For example, if a mail server's domain is example.com, the MTA-STS policy would be published at _mta-sts.example.com. This policy specifies the mail server's TLS support and the expected authentication mechanisms. In a dual-stacked environment, where both IPv4 and IPv6 addresses are used, ensuring that the MTA-STS policy is correctly published and accessible over both protocols is essential.

_mta-sts.example.com. IN TXT "v=STSv1; id=1"

In this example, the MTA-STS policy indicates that the mail server supports TLS encryption (version STSv1) and specifies an identifier (id=1). However, if the DNS records for the _mta-sts subdomain are not properly configured to handle both IPv4 and IPv6, this could lead to issues with DMARC alignment. Specifically, if a mail server attempts to retrieve the MTA-STS policy over IPv6 but the policy is only published for IPv4, or vice versa, the mail server may not be able to validate the policy correctly, potentially leading to authentication failures.

To mitigate these issues, organisations should ensure that their DNS infrastructure is properly configured to support both IPv4 and IPv6 for MTA-STS policy publication and retrieval. This includes setting up appropriate AAAA records for the _mta-sts subdomain to facilitate IPv6 access. For hosted or managed setups, such as those provided by DMARC Engine, the platform typically handles the complexities of DNS configuration for MTA-STS, including ensuring that policies are accessible over both IPv4 and IPv6. This can simplify the process for organisations transitioning to dual-stacked environments.

Another critical aspect to consider is the impact of MTA-STS on the DMARC alignment for domains that use third-party mail services. In such cases, the third-party service may have its own MTA-STS policy, which could affect the DMARC alignment for the domain. For instance, if a domain uses a third-party mail service that only supports IPv4 and has an MTA-STS policy published accordingly, but the domain itself is transitioning to support IPv6, there could be discrepancies in DMARC alignment based on the protocol used.

To address these challenges, organisations should closely examine their mail infrastructure and any third-party services used, ensuring that all components are aligned in their support for IPv6 and that MTA-STS policies are correctly published and accessible. This may involve coordinating with third-party providers to ensure their MTA-STS policies are compatible with the organisation's IPv6 transition plans.

In terms of practical recommendations, organisations undergoing IPv6 transitions should:
- Ensure DNS records for MTA-STS policies are correctly configured for both IPv4 and IPv6.
- Verify that mail servers can retrieve and validate MTA-STS policies over both protocols.
- Review and align MTA-STS policies with any third-party mail services used.
- Monitor DMARC aggregate reports for any issues related to MTA-STS and IPv6 transitions.

By carefully managing MTA-STS in the context of IPv6 transitions, organisations can help maintain strong DMARC alignment and ensure the security and authenticity of their email communications. This requires a detailed understanding of the interplay between MTA-STS, DMARC, and the complexities of dual-stacked mail infrastructure. As organisations navigate these transitions, prioritising the security and integrity of email services is paramount, and properly handling MTA-STS is a critical component of this effort.

Practical Steps for Configuring DMARC in Dual-Stacked Mail Infrastructure

Configuring DMARC for domains with mixed IPv4 and IPv6 mail infrastructure requires careful planning to ensure proper alignment and prevent email delivery issues. The first step is to identify all mail servers, including those used for marketing campaigns, transactional emails, and internal communications. For a domain like example.com, this may involve listing all IP addresses, both IPv4 and IPv6, used by these servers.

In a hosted or managed setup, such as the one we operate at DMARC Engine, this process is simplified through automated discovery tools and comprehensive reporting. However, for organisations managing their mail infrastructure in-house, manual inventory and regular audits are crucial. For instance, a company might have a primary mail server with the IP address 192.0.2.1 and an IPv6 address 2001:db8::1, and a secondary server with IP addresses 198.51.100.1 and 2001:db8:100::1.

When configuring SPF (Sender Policy Framework) for a dual-stacked environment, it's essential to include both IPv4 and IPv6 addresses in the SPF record. A well-structured SPF record for example.com might look like this:

v=spf1 ip4:192.0.2.1 ip6:2001:db8::1 ip4:198.51.100.1 ip6:2001:db8:100::1 -all

This record specifies the IP addresses authorised to send email on behalf of example.com and indicates that all other IP addresses should be rejected (-all).

DKIM (DomainKeys Identified Mail) configuration also requires consideration in a dual-stacked environment. DKIM involves adding a digital signature to emails, which is verified by the recipient's mail server. For domains with multiple mail servers, each server should have its own DKIM key. The DKIM selector and public key should be published in DNS records. For example, if example.com uses a DKIM selector named selector1, the DNS record might look like this:

selector1._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+ycpQMMrdHEm3xWZCZ6C6f+o/6qY7WQ/J2QdZTQ8QW02vzh3yJYJ7r7ZQ4yR5jg8uf+KtP8o8Qdh2YYpSV1gZzdDqkT0m8pROs5H+2O/4O0mN4LlV7Y8yDn9w5l9nPiajwvx9KcG9/OEu5gBn2L3q1urF8z1TOiQIDAQAB"

MTA-STS (Mail Transfer Agent Strict Transport Security) is another protocol that can impact DMARC alignment, particularly in IPv6 transitions. MTA-STS helps prevent Man-in-the-Middle (MITM) attacks by requiring mail servers to use TLS for email delivery. To implement MTA-STS, a domain must publish a policy in its DNS, specifying the version of the protocol and the maximum age of the policy. For example:

mts.sts.example.com. IN TXT "v=STSv1; id=20160831085700Z;"

This policy indicates that example.com supports MTA-STS version 1 and specifies an identifier for the policy.

In a dual-stacked environment, ensuring that all mail servers support both IPv4 and IPv6 and can negotiate TLS connections is crucial for maintaining DMARC alignment and preventing delivery issues. Regular monitoring of aggregate reports and adjusting DMARC policies as necessary are also key to maintaining optimal email deliverability.

For organisations with complex mail infrastructures, hosted or managed DMARC services can simplify the configuration and monitoring process. These services often provide automated tools for discovering mail servers, generating and publishing DMARC, SPF, and DKIM records, and analysing aggregate reports to identify alignment issues. By leveraging these services, organisations can optimise their DMARC configuration, reduce the risk of email delivery problems, and improve the overall security and authenticity of their email communications.

In practice, the configuration of DMARC in a dual-stacked mail infrastructure involves a series of iterative steps, including setting up SPF and DKIM records, publishing an MTA-STS policy, monitoring aggregate reports, and adjusting the DMARC policy as necessary. For example, if a domain receives a high volume of emails that fail DMARC alignment due to SPF issues, the domain owner may need to adjust the SPF record to include additional IP addresses or modify the DMARC policy to a more permissive setting (e.g., from p=reject to p=quarantine) to prevent legitimate emails from being blocked.

Ultimately, the goal of configuring DMARC in a dual-stacked environment is to achieve optimal email deliverability while maintaining the security and authenticity of email communications. By carefully planning and monitoring the DMARC configuration, organisations can reduce the risk of email delivery issues, improve the trustworthiness of their emails, and better protect their brand and recipients from spam and phishing attacks.

Diagnosing and Fixing Alignment Issues with Aggregate Reports

Diagnosing alignment issues in a mixed IPv4 and IPv6 mail infrastructure can be a complex task, especially when dealing with aggregate reports. These reports, typically received via the Aggregate Feedback (RUA) mechanism, provide valuable insights into the authentication results of your emails. However, interpreting these reports requires a deep understanding of DMARC, SPF, and DKIM, as well as the specific nuances of your mail setup.

In a hosted or managed setup, such as what we offer at DMARC Engine, the process of diagnosing alignment issues is somewhat streamlined. Our platform aggregates reports from various sources, providing a centralised view of your domain's authentication performance. This can significantly simplify the process of identifying alignment issues, as you can see at a glance which emails are failing DMARC and why. For instance, our dashboard might highlight a specific mail server that is consistently failing SPF alignment due to an incorrect IPv6 address in its SPF record.

To diagnose alignment issues, you first need to understand the structure of an aggregate report. These reports are sent by receiving mail servers to the address specified in your DMARC record and contain information about the emails they have received that claim to be from your domain. The reports are typically sent in XML format and include details such as the IP address of the sending server, the authentication results for SPF and DKIM, and whether the email passed or failed DMARC.

Here is an example snippet from an aggregate report:

<?xml version="1.0" encoding="UTF-8" ?>
<feedback>
 <version>1.0</version>
 <report_metadata>
 <org_name>example.com</org_name>
 <email>mailto:dmarc@example.com</email>
 <extra_contact_info>http://example.com/dmarc</extra_contact_info>
 <report_id>11111111-1111-1111-1111-111111111111</report_id>
 <date_range>
 <begin>1643723400</begin>
 <end>1646315200</end>
 </date_range>
 </report_metadata>
 <policy_published>
 <domain>example.com</domain>
 <adkim>r</adkim>
 <aspf>r</aspf>
 <p>none</p>
 <sp>none</sp>
 <pct>100</pct>
 </policy_published>
 <record>
 <row>
 <source_ip>2001:0db8:85a3:0000:0000:8a2e:0370:7334</source_ip>
 <count>10</count>
 <policy_evaluated>
 <disposition>none</disposition>
 <dkim>pass</dkim>
 <spf>fail</spf>
 </policy_evaluated>
 </row>
 </record>
</feedback>

In this example, the report indicates that there were 10 emails from the IPv6 address 2001:0db8:85a3:0000:0000:8a2e:0370:7334 that passed DKIM but failed SPF, resulting in a DMARC failure. This information is crucial for identifying the source of alignment issues.

Fixing alignment issues often involves updating your SPF or DKIM records to ensure that they correctly reflect your mail infrastructure. For SPF, this might mean adding the IPv6 addresses of your mail servers to your SPF record. For DKIM, it could involve updating the selector records to point to the correct public key for your domain.

When updating your SPF record to include IPv6 addresses, it's essential to consider the size limit of DNS responses. An SPF record that is too large can result in a truncated response, which can lead to SPF failures. To mitigate this, you can use mechanisms like ip6 to specify IPv6 networks or include to reference other SPF records. For example:

v=spf1 ip4:192.0.2.1 ip6:2001:0db8:85a3:0000:0000:8a2e:0370:7334 include:_spf.example.com -all

In a mixed IPv4 and IPv6 environment, managing these records can become complex, especially if you have a large number of mail servers. This is where a hosted or managed DMARC solution can provide significant benefits, as it can help automate the process of updating and managing your SPF and DKIM records, ensuring that they remain accurate and up-to-date.

Another common issue encountered when diagnosing alignment problems is the presence of third-party senders. These are services or applications that send emails on your behalf, such as marketing platforms or customer support software. If these senders are not properly configured, they can cause alignment issues. For instance, if a third-party sender is using your domain in the From header but is not authenticating with your SPF or DKIM records, it can lead to DMARC failures.

To address this, it's crucial to identify all third-party senders that are sending emails on your behalf and ensure they are configured to authenticate correctly. This might involve adding their IP addresses to your SPF record or setting up custom DKIM selectors for them. In some cases, you may need to work with the third-party provider to implement the necessary changes.

In conclusion to this section, diagnosing and fixing alignment issues with aggregate reports requires a detailed understanding of your mail infrastructure and the DMARC, SPF, and DKIM protocols. By carefully analysing aggregate reports and making targeted updates to your SPF and DKIM records, you can improve the deliverability of your emails and protect your domain from spoofing. Whether you manage your DMARC setup in-house or use a hosted solution, the key to success lies in ongoing monitoring and prompt action to address any issues that arise.

Operational Guidance for DMARC Record Examples and Best Practices

When managing DMARC for domains with mixed IPv4 and IPv6 mail infrastructure, the centre of attention should be on optimising the DMARC record to accurately reflect the organisation's mail streams. This involves carefully considering the SPF and DKIM alignment modes, as these directly impact the effectiveness of DMARC in preventing spam and phishing attacks. A key decision is whether to use relaxed or strict alignment for SPF and DKIM.

In a hosted or managed setup, such as what we offer at DMARC Engine, the default is often set to relaxed alignment, which allows for a greater degree of flexibility in mail server configurations. However, this may not be the best choice for all organisations, particularly those with complex mail infrastructures that involve multiple servers and third-party senders. For instance, consider a domain that uses a combination of in-house mail servers and cloud-based services for email marketing. In this scenario, strict alignment might be more appropriate to ensure that only authorised senders can send emails on behalf of the domain.

To illustrate the difference, let's examine a DMARC record snippet:

_dmarc.example.com. IN TXT "v=DMARC1; p=none; sp=none; adkim=r; aspf=r; fo=1"

In this example, adkim=r and aspf=r specify relaxed alignment for DKIM and SPF, respectively. If we were to change these to adkim=s and aspf=s, we would be using strict alignment, which requires an exact match between the sender's domain and the domain in the From header.

Another critical aspect of DMARC record configuration is the policy setting, which determines the action to be taken when an email fails DMARC validation. The policy can be set to none, quarantine, or reject, depending on the organisation's risk tolerance and email security posture. For example:

_dmarc.example.com. IN TXT "v=DMARC1; p=quarantine; sp=none; adkim=r; aspf=r; fo=1"

Here, the policy is set to quarantine, which means that emails that fail DMARC validation will be marked as suspicious and may be subjected to additional scrutiny by the recipient's email server.

In terms of best practices, it's essential to monitor aggregate reports (RUA) regularly to identify potential issues with DMARC alignment and to adjust the DMARC record accordingly. These reports provide valuable insights into email authentication failures and can help organisations optimise their DMARC configuration. For instance, if an organisation notices a high rate of SPF alignment failures, it may indicate that there are unauthorised senders attempting to send emails on behalf of the domain. By analysing the RUA reports, the organisation can identify the sources of these failures and take corrective action to prevent them.

When configuring DMARC in a dual-stacked environment, it's also crucial to consider the impact of MTA-STS (Mail Transfer Agent Strict Transport Security) on email authentication. MTA-STS is a protocol that enables mail servers to declare their ability to support TLS encryption for email transmissions. If an organisation has MTA-STS enabled, it can affect the DMARC alignment, particularly if there are mail servers that do not support TLS. In such cases, it's essential to ensure that the DMARC record is configured to accommodate the MTA-STS policy. For example:

_mta-sts.example.com. IN TXT "v=MTA-STS; v=1"

This record snippet declares the MTA-STS policy for the domain, which can be used in conjunction with the DMARC record to optimise email authentication.

To further illustrate the complexities of DMARC configuration in mixed IPv4 and IPv6 environments, consider a scenario where an organisation has multiple mail servers, each with its own IP address and DNS configuration. In this case, the DMARC record must be carefully crafted to ensure that all mail servers are properly authenticated and that emails are correctly aligned with the domain's DMARC policy. This may involve using multiple SPF records, each with its own set of IP addresses, and configuring DKIM to use a specific selector for each mail server.

In conclusion to this section, effective DMARC configuration requires a deep understanding of the organisation's mail infrastructure, as well as the intricacies of email authentication protocols. By carefully considering the DMARC alignment modes, policy settings, and MTA-STS configuration, organisations can optimise their email security posture and prevent spam and phishing attacks. As a hosted or managed DMARC service provider, we recommend that organisations regularly review their DMARC configuration and adjust it as needed to ensure the best possible protection against email-based threats.

For domains with complex mail infrastructures, it's often beneficial to use a managed DMARC service that can provide expert guidance and support in configuring and maintaining the DMARC record. This can help organisations navigate the complexities of DMARC configuration and ensure that their email security posture is optimised for their specific needs. Also, managed DMARC services can provide valuable insights and analytics on email authentication failures, which can help organisations identify and address potential security issues before they become major problems.

In our experience, one of the most common mistakes organisations make when configuring DMARC is failing to properly test their DMARC record before deploying it in production. This can lead to unintended consequences, such as emails being incorrectly flagged as spam or blocked by recipient email servers. To avoid this, we recommend that organisations use a staging environment to test their DMARC record and ensure that it is properly configured before deploying it to production.

By following these best practices and carefully considering the complexities of DMARC configuration, organisations can ensure that their email security posture is optimised and that they are protected against spam and phishing attacks. Whether you are managing a simple mail infrastructure or a complex, dual-stacked environment, a well-configured DMARC record is essential for maintaining the security and integrity of your email communications.

Organisations should also be aware of the colour coding used in DMARC reports, which can help to quickly identify potential issues with email authentication. For example, a red colour may indicate a high rate of authentication failures, while a green colour may indicate that emails are being properly authenticated. By using these colour codes, organisations can quickly identify areas for improvement and take corrective action to optimise their DMARC configuration.

Finally, it's essential to note that DMARC configuration is not a one-time task, but rather an ongoing process that requires regular monitoring and maintenance. As email authentication protocols continue to evolve, organisations must stay up-to-date with the latest best practices and configuration guidelines to ensure that their email security posture remains optimised. By working with a managed DMARC service provider and staying informed about the latest developments in email authentication, organisations can ensure that their DMARC configuration remains effective and secure over time.

To organise their DMARC configuration and ensure that it is properly maintained, organisations should consider using a centralised management platform that can provide a single point of control for all DMARC-related settings and configurations. This can help to simplify the process of managing DMARC and ensure that all mail servers and email senders are properly authenticated and aligned with the domain's DMARC policy. By using a centralised management platform, organisations can also gain valuable insights into their email authentication performance and identify areas for improvement.

In terms of specific recommendations, we advise organisations to use a DMARC record with a policy setting of quarantine or reject, depending on their risk tolerance and email security posture. We also recommend using relaxed alignment for SPF and DKIM, unless the organisation has a simple mail infrastructure and can ensure that all mail servers are properly configured and authenticated. Also, organisations should ensure that their MTA-STS configuration is properly aligned with their DMARC record, to prevent any potential issues with email authentication.

By following these guidelines and best practices, organisations can ensure that their DMARC configuration is optimised for their specific needs and that they are protected against spam and phishing attacks. Whether you are managing a small mail infrastructure or a large, complex environment, a well-configured DMARC record is essential for maintaining the security and integrity of your email communications.

To illustrate the importance of proper DMARC configuration, consider a real-world example of an organisation that failed to properly configure its

Trade-Offs and Considerations for DMARC Policy Settings in Complex Environments

When managing DMARC for domains with mixed IPv4 and IPv6 mail infrastructure, the policy settings are crucial in achieving optimal deliverability while preventing spoofing. A key consideration is the trade-off between strict policy settings and the potential for false positives, which can lead to legitimate emails being blocked. For instance, setting a DMARC policy to p=reject can effectively prevent spoofing, but it may also block emails from legitimate sources that do not align with the domain's DMARC records.

In a hosted setup like ours at DMARC Engine, we often see customers who are hesitant to move to a strict p=reject policy due to concerns about blocking legitimate emails. This is particularly true for domains with complex mail infrastructures that involve multiple mail servers, some of which might not be fully aligned with DMARC. To mitigate this risk, we recommend a gradual approach, starting with a p=none policy for monitoring, then moving to p=quarantine before finally adopting p=reject. This gradual tightening of the policy allows for the identification and rectification of any alignment issues before potentially blocking legitimate emails.

Another critical aspect is the management of subdomains. In complex environments, subdomains are often used for various services, and each might have its own mail servers. The DMARC policy for the parent domain does not automatically apply to subdomains unless specified. For example, if a domain has a DMARC record like the following:

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

This policy applies only to the parent domain example.com and not to any subdomains like sub.example.com. To apply the same policy to subdomains, the sp tag can be used, but this needs to be carefully considered as it might not be desirable for all subdomains, especially if they have their own distinct mail handling setups.

The pct tag is also an important consideration in complex environments. This tag specifies the percentage of emails to which the DMARC policy should be applied. Setting pct=100 means the policy applies to all emails, which is ideal for preventing spoofing but may cause issues if not all mail servers are fully DMARC compliant. In mixed IPv4 and IPv6 environments, it might be necessary to initially set a lower percentage, such as pct=20, to test the waters, so to speak, and ensure that the DMARC policy does not inadvertently block a significant volume of legitimate emails.

For domains with multiple mail servers, some of which may support IPv6 while others do not, the SPF alignment becomes particularly crucial. SPF records need to include all the IP addresses of mail servers that send emails on behalf of the domain. For IPv6, this means including the IPv6 addresses in the SPF record, which can become cumbersome due to the longer length of IPv6 addresses compared to IPv4. For example, an SPF record that includes both IPv4 and IPv6 addresses for mail servers might look like this:

example.com. IN TXT "v=spf1 ip4:192.0.2.1 ip6:2001:0db8:85a3:0000:0000:8a2e:0370:7334 -all"

This record specifies that emails sent from the IPv4 address 192.0.2.1 and the IPv6 address 2001:0db8:85a3:0000:0000:8a2e:0370:7334 are authorised to send emails on behalf of example.com.

DKIM alignment is another area that requires careful consideration. DKIM involves cryptographic authentication, which can be more complex to set up and manage, especially in environments with multiple mail servers and both IPv4 and IPv6 protocols in use. The DKIM selector and the domain must align with the DMARC record for the email to pass DMARC validation. A misconfigured DKIM setup can lead to emails failing DMARC checks, even if they are legitimate.

In our experience, managing DKIM in complex environments often involves creating separate DKIM selectors for different mail servers or services. This allows for easier management and troubleshooting of DKIM alignment issues. For instance, a domain might use one DKIM selector for its primary mail server and another for a marketing service that sends emails on its behalf. Each selector would have its own public key published in a TXT record, like so:

selector1._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQAB"

This approach enables the domain to manage and rotate DKIM keys independently for each service, reducing the complexity of DKIM management in mixed IPv4 and IPv6 environments.

MTA-STS (Mail Transfer Agent Strict Transport Security) is another protocol that can impact DMARC alignment, particularly during IPv6 transitions. MTA-STS is a mechanism for mail servers to declare their ability to support secure (TLS) connections. In environments where mail servers are transitioning to IPv6, ensuring that MTA-STS is properly configured can help maintain the security and integrity of email communications. However, if not all mail servers support MTA-STS or if there are issues with the TLS certificates, this can lead to delivery problems, including DMARC failures.

In conclusion to this section, the trade-offs and considerations for DMARC policy settings in complex environments with mixed IPv4 and IPv6 mail infrastructure are multifaceted. They involve balancing the need to prevent spoofing with the risk of blocking legitimate emails, managing subdomains and their DMARC policies, configuring SPF and DKIM for alignment, and ensuring MTA-STS does not introduce additional complications. By understanding these complexities and taking a gradual, well-planned approach to DMARC deployment, domains can effectively optimise their email deliverability and security in dual-stacked environments.

Real-World Examples and Case Studies of Successful DMARC Deployments

Deploying DMARC in environments with mixed IPv4 and IPv6 mail infrastructure can be complex, requiring careful consideration of SPF, DKIM, and MTA-STS configurations to achieve optimal alignment. At DMARC Engine, we have worked with numerous customers to navigate these challenges, and several case studies illustrate the importance of meticulous planning and configuration.

One such example is a large financial institution that approached us with a dual-stacked mail infrastructure, utilising both IPv4 and IPv6 for their mail servers. Initially, their DMARC record was set to a policy of none, with a low percentage of messages being authenticated due to alignment issues. To improve this, we worked closely with their team to optimise their SPF records, ensuring that all mail servers, including those with IPv6 addresses, were correctly listed. This involved adding IPv6 addresses to their SPF records, as shown in the following example:

v=spf1 ip4:192.0.2.1 ip6:2001:db8::1 include:_spf.example.com -all

By including both the IPv4 and IPv6 addresses of their mail servers in the SPF record, we significantly improved SPF alignment, which in turn positively affected their overall DMARC alignment.

Another critical aspect of their deployment was DKIM. The institution was using a third-party mailing service that was not signing messages with a DKIM key aligned with their domain. To resolve this, we assisted them in setting up a custom DKIM key with the mailing service, ensuring that the selector and domain aligned with their DMARC policy. The resulting DKIM record looked similar to this:

default._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq1Rc5Rz+ntL6rHbLzj0k4RtY4Y6os5j0j6NV/4M6HhAKj7h2KL0j0j6NV/4M6HhAKj7h2KL0j0j6NV/4M6H"

This change improved DKIM alignment, further enhancing the institution's overall DMARC compliance.

MTA-STS also played a crucial role in their deployment. As they were transitioning some of their mail servers to IPv6, we recommended implementing MTA-STS to ensure that mail sent from these servers was encrypted and authenticated. The MTA-STS record we helped them set up looked like this:

mta-sts.example.com. IN TXT "v=STSv1; id=2023022201"

And the accompanying policy file defined the expected behaviour for mail servers:

{
 "version": "STSv1",
 "mode": "enforce",
 "mx": "mail.example.com",
 "max_age": 604800
}

This setup ensured that their mail servers, including those on IPv6, were not only authenticated but also encrypted, which is essential for protecting sensitive financial information.

In another case, a managed hosting provider approached us with concerns about DMARC alignment for their customers' domains. They were experiencing issues with SPF alignment due to the dynamic nature of their hosting environment, where customers' mail servers could be hosted on either IPv4 or IPv6 addresses. To address this, we implemented a dynamic SPF generation system that automatically included the correct IP addresses, whether IPv4 or IPv6, based on the customer's mail server setup. This involved creating a script that queried their database for the IP addresses associated with each domain and then generated an SPF record accordingly. An example output of this script for a domain might look like this:

v=spf1 include:ipv4.spf.example.net include:ipv6.spf.example.net -all

With this dynamic system in place, the hosting provider saw a significant reduction in SPF alignment issues, which in turn improved their customers' DMARC compliance.

For domains with multiple mail servers, especially in mixed IPv4 and IPv6 environments, it's also crucial to consider the impact of DMARC policy settings. A too restrictive policy can lead to legitimate emails being rejected, while a too permissive policy may not effectively prevent spoofing. We generally recommend starting with a monitoring policy (p=none) to gauge the current authentication state of emails sent from the domain, before moving to a more restrictive policy (p=quarantine or p=reject) as alignment improves.

The key to successful DMARC deployments in complex environments is meticulous planning, careful configuration of SPF, DKIM, and MTA-STS, and ongoing monitoring of aggregate reports to identify and address alignment issues. By understanding the specific challenges of mixed IPv4 and IPv6 mail infrastructure and applying targeted solutions, organisations can significantly improve their email authentication and security posture, protecting their brand and users from phishing and spoofing attacks.

In hosted or managed setups, such as those provided by DMARC Engine, the process of configuring and managing DMARC, SPF, DKIM, and MTA-STS is streamlined, allowing organisations to focus on their core activities while benefiting from enhanced email security. These services often include automated tools for generating and updating DNS records, real-time monitoring of email authentication, and expert guidance on policy settings and alignment issues, making it easier for organisations to navigate the complexities of email security in dual-stacked environments.

Ultimately, the goal of DMARC deployment is to achieve a state where all emails sent from a domain are authenticated, thereby preventing spoofing and enhancing the trustworthiness of the domain. Through careful planning, precise configuration, and the use of appropriate tools and services, organisations can overcome the challenges of mixed IPv4 and IPv6 mail infrastructure and successfully deploy DMARC, significantly improving their email security and protecting their brand reputation.

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.