How to Set Up SPF, DKIM and DMARC for a Custom Domain
If you send email from a custom domain, publishing an MX record is only the beginning. SPF, DKIM, and DMARC work together to help receiving servers verify who sent a message and what to do when authentication fails.
This guide explains the role of each record, a safe order for deploying them, and the mistakes that most often break domain email.
What each record does
SPF: authorize sending infrastructure
SPF is a TXT record that lists the services permitted to send mail for your domain. A receiving server compares the message path with that policy.
Example:
v=spf1 include:amazonses.com -all
Use the include value supplied by your email provider. A domain should normally have one SPF record. If you already have one, merge the required mechanisms instead of publishing a second SPF TXT record.
DKIM: sign outgoing messages
DKIM adds a cryptographic signature to outgoing mail. Your provider keeps the private key and asks you to publish a public key, commonly through one or more CNAME records.
A DKIM hostname includes a selector. For example:
selector1._domainkey.example.com
Do not invent the selector. Copy the host and target values supplied by the sending provider. Also check whether your DNS dashboard automatically appends the root domain; entering the full hostname in such a dashboard can create a duplicated name.
DMARC: define policy and reporting
DMARC tells receivers how to handle messages that fail aligned SPF or DKIM checks. A cautious starting policy is:
v=DMARC1; p=none; rua=mailto:dmarc@example.com
The monitoring policy collects reports without requesting quarantine or rejection. Review legitimate senders first, then consider moving gradually to p=quarantine and finally p=reject.
Recommended setup order
- Verify ownership of the domain with the TXT record supplied by your provider.
- Configure the MX record for inbound delivery.
- Publish or merge the SPF policy.
- Add every DKIM selector supplied by the provider.
- Publish DMARC initially in monitoring mode.
- Wait for DNS caches to refresh and verify the public records.
Keep unrelated website A, AAAA, and CNAME records unchanged. Email DNS changes should not require moving your website or nameservers.
Common mistakes to avoid
- Publishing two SPF records on the same hostname.
- Copying example DKIM selectors instead of the provider's real values.
- Adding the domain twice in a DNS dashboard that automatically appends it.
- Enforcing DMARC before all legitimate senders are authenticated.
- Replacing website records while changing email DNS.
- Assuming a visible DNS record means every resolver has refreshed.
Verify the result
After saving the records, query public DNS rather than relying only on what the provider dashboard displays. You can inspect MX, SPF, DMARC, A, AAAA, and nameserver records with the Free Domain Mail DNS Checker.
For practical examples, see the DMARC record examples guide and the DKIM setup guide.
Here is a short visual overview of the setup flow:
https://www.youtube.com/watch?v=1EQELQDziyw
Final checklist
- One valid SPF policy
- Every provider-issued DKIM selector published
- A DMARC record at _dmarc.yourdomain.com
- Correct MX destination and priority
- Authentication checked from public DNS
Email authentication improves trust, but it does not guarantee inbox placement. Sending reputation, message content, complaint rates, and recipient behavior still matter.
Free Domain Mail provides guided DNS setup, simple custom-domain webmail, and free DNS inspection tools for freelancers, developers, solo founders, and small projects.
About the author
- Free Domain Mail – Simple Webmail for Domains You Already Own https://freedomainmail.com/
Comments
Join the discussionNo comments yet. Be the first to comment.