schedule 15-min read

How to Add a DMARC Record in Amazon Route 53

DMARC AI editorial team · Last updated

Add a DMARC TXT record in Amazon Route 53 with the console or AWS CLI: _dmarc name, quoted value, TTL, delegation checks and SES alignment for MSPs.

01

How do you add a DMARC record in Amazon Route 53?

To add a DMARC record in Amazon Route 53, open Hosted zones, choose the domain's public hosted zone, select Create record, type _dmarc as the record name, choose TXT, and enter the value in double quotes, for example "v=DMARC1; p=none; rua=mailto:reports@example.net". Set a TTL and select Create records.

The quotes are the Route 53 detail that trips people up: AWS stores TXT values as quoted strings and expects you to type them. This guide covers the console steps, the quoting and 255-character rules, an AWS CLI change batch with correctly escaped quotes, public versus private hosted zones, delegation checks, Amazon SES alignment and least-privilege access for MSPs. For what each tag means, follow how to create a DMARC record step by step; for the protocol itself, see the DMARC guide.

02

Key takeaways

  • The DMARC record is a TXT record named _dmarc.example.com in the domain's public hosted zone. Records in a private hosted zone are never seen by internet mail receivers.
  • Type the value inside double quotes. Route 53 limits each quoted string to 255 characters and a whole TXT value to 4,000 characters.
  • In the AWS CLI, UPSERT replaces the whole record set, which is what you want for a single _dmarc record. The quotes must be escaped as " inside the JSON.
  • A Route 53 zone only answers for the domain when the registrar's NS records list that zone's four name servers. Check before you edit.
  • If the domain sends through Amazon SES, Easy DKIM aligns with the From domain. A custom MAIL FROM domain adds aligned SPF, provided the DMARC record does not set aspf=s.
03

Which hosted zone should hold the DMARC record?

Use the public hosted zone that the domain is delegated to. Route 53 lets you create more than one hosted zone with the same name, each with its own four name servers, and it never returns records from a zone the registrar does not point to. A private hosted zone only answers queries from inside associated VPCs.

AWS's public hosted zone considerations state that every hosted zone gets a unique set of four name servers, and that you must give your registrar the name servers of the zone that holds the records you want served. Duplicate zones are common in AWS accounts that have been through a migration or a test, and a _dmarc record added to the wrong one is invisible.

Zone type Who sees its records Put _dmarc here?
Public hosted zone, delegated at the registrar Everyone on the internet Yes
Public hosted zone with the same name, not delegated Nobody No: find the delegated zone instead
Private hosted zone (split-view DNS) Only resources in the associated VPCs No: receivers never query it

The private hosted zone documentation adds a testing trap. If a VPC is associated with a private zone called example.com and that zone has no _dmarc name, the VPC Resolver returns NXDOMAIN and does not retry against public DNS unless public DNS fallback is enabled. A dig run from an EC2 instance in that VPC can therefore report no DMARC record even though the public zone is correct. Test from outside the VPC.

04

How do you check the domain is delegated to Route 53?

Compare the domain's live NS records with the four name servers in the hosted zone. In the console, open Hosted zones, select the zone's radio button, choose View details and read Name servers under Hosted zone details. Then query the NS records from a machine outside AWS.

$ dig +short NS example.com
ns-1234.awsdns-26.org.
ns-567.awsdns-07.net.
ns-89.awsdns-11.com.
ns-1890.awsdns-44.co.uk.

If the four names match the zone, Route 53 is authoritative and the record belongs there. If they differ, either the domain uses another Route 53 zone (check for duplicates) or another DNS host entirely. In that case add the record where DNS actually lives: Cloudflare, Azure DNS or cPanel. On Windows, Resolve-DnsName -Name example.com -Type NS gives the same answer, and our DNS lookup tool works without a terminal.

AWS documents the console steps in getting the name servers for a public hosted zone.

05

How do you create the DMARC record in the Route 53 console?

In the Route 53 console, choose Hosted zones, open the zone by name, select Create record, and use simple routing. Enter _dmarc in Record name, choose TXT as Record type, paste the quoted DMARC string into Value, set TTL (seconds) and select Create records. The steps follow AWS's creating records guide.

  1. Sign in to the AWS account that owns the delegated zone and open the Route 53 console.
  2. In the navigation pane, choose Hosted zones, then choose the zone name, for example example.com.
  3. Check the record list for an existing _dmarc.example.com TXT record. If one exists, edit it rather than creating another.
  4. Choose Create record. Keep Simple routing.
  5. Record name: _dmarc. The console shows the zone name after the box, so the full name becomes _dmarc.example.com.
  6. Record type: TXT.
  7. Value: the DMARC string on one line, inside double quotes.
  8. TTL (seconds): 300 while you are changing things. AWS recommends a short value such as 300 seconds when you change a record in use, raising it once the setting is confirmed.
  9. Choose Create records.

A first record in monitoring mode, as typed into Value:

"v=DMARC1; p=none; rua=mailto:dmarc-reports@example.net"

AWS's SES documentation on complying with DMARC uses the same pattern: a TXT record named _dmarc.example.com with a quoted v=DMARC1 value. AWS says changes generally reach all Route 53 name servers within 60 seconds; resolvers that cached an older answer keep it until its TTL expires.

For a subdomain in the same zone, enter _dmarc.marketing for marketing.example.com. More patterns are in DMARC record examples for common setups and DMARC for subdomains.

06

What are the Route 53 TXT quoting and 255-character rules?

Route 53 treats a TXT value as one or more strings enclosed in double quotes. Each string can hold up to 255 characters, and the whole value up to 4,000. For anything longer than 255 characters, split it into several quoted strings on the same line, separated by a space. A DMARC record rarely needs this.

The rules come from AWS's supported DNS record types page:

  • Quotes: enclose each string in ". To include a literal quotation mark inside a string, escape it as ".
  • Length: 255 characters per string; split longer values as "String 1" "String 2" on one line in the console.
  • One value per row: in the console, each line in Value is a separate TXT record. Two lines at _dmarc would publish two DMARC records.
  • Special characters: characters outside printable ASCII use octal escapes, such as 344 for an accented letter. A DMARC string needs none.
  • Case: Route 53 preserves case, so type v=DMARC1 exactly.

Receivers rebuild a split value: RFC 9989, Section 4.5, says the evaluating module must concatenate the strings in order and parse the result as one string. The split mainly matters for long DKIM keys, covered in DKIM key length: 1024 vs 2048.

The "one value per row" rule is the one that breaks DMARC. Under RFC 9989, Section 4.10, if multiple DMARC records are returned for one name, they are all discarded, so a second line leaves the domain with no policy at all.

07

How do you add the DMARC record with the AWS CLI?

Use aws route53 change-resource-record-sets with the hosted zone ID and a JSON change batch. Set Action to UPSERT, Name to _dmarc.example.com, Type to TXT, and put the value in ResourceRecords with its double quotes escaped as ". UPSERT creates the record set or replaces it entirely.

First find the public zone's ID:

aws route53 list-hosted-zones-by-name --dns-name example.com 
  --query "HostedZones[?Name=='example.com.' && Config.PrivateZone==`false`].Id"

Save the change batch as dmarc.json:

{
  "Comment": "DMARC monitoring policy for example.com",
  "Changes": [
    {
      "Action": "UPSERT",
      "ResourceRecordSet": {
        "Name": "_dmarc.example.com",
        "Type": "TXT",
        "TTL": 300,
        "ResourceRecords": [
          { "Value": ""v=DMARC1; p=none; rua=mailto:dmarc-reports@example.net"" }
        ]
      }
    }
  ]
}

Apply it and check the change status:

aws route53 change-resource-record-sets 
  --hosted-zone-id Z0123456789EXAMPLE 
  --change-batch file://dmarc.json

aws route53 get-change --id /change/C0123456789EXAMPLE

The CLI reference describes CREATE, DELETE and UPSERT, and says Route 53 applies all or none of the changes in a batch. The response contains a ChangeInfo block whose Status is PENDING until every Route 53 name server has the change, then INSYNC.

Why does UPSERT matter for DMARC?

Because UPSERT replaces every value in the _dmarc TXT record set with the values in the request. Moving from p=none to p=quarantine is the same file with a new value, and the old one disappears in the same transaction. That is safer than the Azure CLI's add-record, which appends a second value.

The flip side: if the _dmarc set ever held a non-DMARC TXT value you need, UPSERT removes it unless you list it in ResourceRecords too. Read the set first:

aws route53 list-resource-record-sets --hosted-zone-id Z0123456789EXAMPLE 
  --query "ResourceRecordSets[?Name=='_dmarc.example.com.']"

08

Should the Route 53 DMARC record include pct?

No. RFC 9989 replaced RFC 7489 and removed the pct, ri and rf tags, so leave them out even if an older template includes them. Publish each policy in full: p=none, then p=quarantine, then p=reject. For a cautious step, t=y asks receivers to apply the next lower policy.

"v=DMARC1; p=quarantine; t=y; rua=mailto:dmarc-reports@example.net"

Remove t=y once the level is confirmed. RFC 9989 also adds np for non-existent subdomains, explained in the np tag guide. The UK NCSC email security and anti-spoofing guidance follows the same principle: start at none, use reports to fix legitimate senders, then enforce.

09

How does Amazon SES affect DMARC alignment on a Route 53 domain?

SES mail passes DMARC when Easy DKIM signs with the From domain, which aligns on its own. SPF only aligns if you configure a custom MAIL FROM subdomain, because by default SES uses a subdomain of amazonses.com as the envelope sender. Keep SPF alignment relaxed: AWS says SPF alignment through SES requires that the DMARC record does not set aspf=s.

Route 53 makes the DNS side easier when it is in the same AWS account as SES. According to AWS's identity creation guide, the SES console can publish the Easy DKIM CNAME records and the MAIL FROM MX and TXT records to Route 53 for you, through the Publish DNS records to Route53 option. The custom MAIL FROM guide offers a Publish Records Using Route 53 button for the same records. The DMARC record is yours to add, as described above.

When SES and Route 53 sit in different AWS accounts, which is common when an application team owns SES and the MSP owns DNS, AWS says to add the records manually in Route 53. The full SES procedure, including Regions and the MX failure behaviour, is in DMARC and Amazon SES. For the alignment rules themselves, see DMARC alignment explained.

10

How do you verify the DMARC record after publishing?

Query _dmarc from outside AWS and confirm exactly one DMARC record comes back, as one quoted string with the value you intended. Then query one of the zone's own name servers to rule out resolver caching.

$ dig +short TXT _dmarc.example.com
"v=DMARC1; p=none; rua=mailto:dmarc-reports@example.net"

$ dig @ns-89.awsdns-11.com +short TXT _dmarc.example.com

On Windows:

Resolve-DnsName -Name _dmarc.example.com -Type TXT
nslookup -type=TXT _dmarc.example.com

The DMARC checker validates the syntax and flags duplicates, and how to check your DMARC policy explains what the result means. If a lookup says no record exists, work through how to fix "no DMARC record found".

11

How should MSPs manage DMARC across many Route 53 zones?

Treat each client's AWS account as a separate DNS host with its own access path, and give your team the narrowest permission that can change _dmarc. Route 53 supports IAM conditions that restrict route53:ChangeResourceRecordSets to named records, record types and actions, so a DMARC role does not need rights over the whole zone.

The fine-grained access control page defines three condition keys: route53:ChangeResourceRecordSetsNormalizedRecordNames, route53:ChangeResourceRecordSetsRecordTypes and route53:ChangeResourceRecordSetsActions. Record names must be lowercase, without the trailing dot. A policy allowing only _dmarc TXT changes in one zone:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "route53:ChangeResourceRecordSets",
      "Resource": "arn:aws:route53:::hostedzone/Z0123456789EXAMPLE",
      "Condition": {
        "ForAllValues:StringEquals": {
          "route53:ChangeResourceRecordSetsNormalizedRecordNames": ["_dmarc.example.com"],
          "route53:ChangeResourceRecordSetsRecordTypes": ["TXT"],
          "route53:ChangeResourceRecordSetsActions": ["CREATE", "UPSERT"]
        }
      }
    }
  ]
}

Add read actions such as route53:ListResourceRecordSets and route53:GetChange if the same role must read the record back and check the change status.

  • Inventory: in each client account, list the public zones and confirm every sending domain has a _dmarc record. Watch for duplicate zones with the same name.
  • One profile per client: use a named AWS CLI profile for each client account so a change batch never lands in the wrong one.
  • Change records: keep the old and new dmarc.json files with the reason for the change, so a rollback is one command. DMARC change management for MSP portfolios suggests a format.
  • Report destinations: if reports go to a mailbox on another domain, that domain must publish an authorisation record such as example.com._report._dmarc.example.net with the value v=DMARC1, as defined in RFC 9990, Section 4. See authorising external DMARC report destinations.

DMARC AI collects aggregate reports for every client domain in one multi-tenant view, so you can see whether SES and every other sender align before you move a client from p=none to enforcement. More on running DMARC as a managed service is on DMARC for MSPs.

12

What should you check when the Route 53 DMARC record does not work?

Start with delegation, then the zone type, then the record count. Most Route 53 DMARC problems come from editing an undelegated or private zone, a second value in the _dmarc record set, or a quoting mistake. The table lists the usual symptoms and fixes.

Symptom Likely cause Fix
Record visible in the console, dig from the internet returns nothing Zone is not the one the registrar delegates to Compare dig NS with the zone's name servers; edit the delegated zone
dig from an EC2 instance returns NXDOMAIN, public lookup works VPC associated with a private zone of the same name Test from outside the VPC; the public record is fine
Record exists only in a private hosted zone Added to the split-view internal zone Create it in the public hosted zone
Checker reports no valid policy Two lines in Value, so two DMARC records Keep one value; RFC 9989 discards all when more than one returns
CharacterStringTooLong error A string over 255 characters Split into quoted strings of 255 or fewer on one line
CLI rejects the change batch JSON Unescaped quotes inside Value Write the value as ""v=DMARC1; ...""
Old policy still returned after an edit Resolvers caching the previous answer Wait for the old TTL; query a Route 53 name server directly
Zone recreated, records missing for everyone New zone has new name servers Update the registrar's NS records to the new zone's four servers
SES mail fails SPF alignment Default MAIL FROM, or aspf=s in the record Configure a custom MAIL FROM; keep SPF alignment relaxed
No aggregate reports arrive No rua tag, or external rua without authorisation Add rua; publish the receiver's _report._dmarc record
13

Frequently asked questions

Do I need quotes around a DMARC record in Route 53?

Yes. AWS describes a TXT record as one or more strings enclosed in double quotation marks, and its examples show the quotes typed into the console's Value field. Enter "v=DMARC1; p=none; rua=mailto:...". In the AWS CLI JSON, escape those quotes as " inside the Value string.

What record name do I enter for DMARC in Route 53?

Enter _dmarc in the Record name box of the domain's public hosted zone. The console shows the zone name after the box, so the record becomes _dmarc.example.com. In the AWS CLI, give the full name, _dmarc.example.com, in the change batch's Name field.

Does Amazon SES add the DMARC record to Route 53 automatically?

No. When Route 53 is in the same account, the SES console can publish the Easy DKIM CNAMEs and the custom MAIL FROM MX and TXT records for you. The DMARC record is a separate TXT record at _dmarc that you create in the hosted zone yourself, following AWS's DMARC guidance for SES.

How long does a Route 53 DMARC change take to work?

AWS says changes generally reach all Route 53 name servers within 60 seconds, and the CLI's get-change reports INSYNC when they have. Resolvers that cached the previous answer keep it until its TTL expires, which is why a 300-second TTL helps while you are changing policy.

Can I put the DMARC record in a private hosted zone?

You can create it, but internet mail receivers will never see it. A private hosted zone only answers queries from resources inside its associated VPCs. Receivers query public DNS, so the DMARC record must be in the public hosted zone that the registrar delegates the domain to.

14

Next steps

Adding a DMARC record in Route 53 takes a minute; the care goes into the checks around it. Confirm which public zone is delegated, type the value in quotes, keep one _dmarc value, and use UPSERT with escaped quotes when you script it. Then let aggregate reports, SES included, decide when each client moves from p=none to p=reject.

Related articles

Related tools

Ready to Implement?

Get authenticated mail moving in minutes: start free, book a guided demo, or talk to the team about your stack.