Why these records matter
Four DNS records decide whether email to and from your domain works properly:
- MX tells the world where to deliver mail for your domain.
- SPF lists the servers allowed to send mail from your domain.
- DKIM adds a digital signature to every message you send.
- DMARC tells receiving servers what to do with mail that fails SPF and DKIM, and sends you reports.
Get them right and your mail is far more likely to land in the inbox. It also becomes much harder for someone to send fake mail that looks like it came from you.
Note: On GOLDNET hosting and email plans, we set up SPF, DKIM and DMARC for you. If your domain uses our nameservers, there's nothing to do. If your DNS is somewhere else, your hosting account page lists the exact records to add there.
The examples below use example.co.za. Always copy the real values from your account page.
MX: where your mail is delivered
example.co.za. MX 10 mail.example.co.za.
The number is a priority: lower numbers are tried first. Point your MX records only at the mail service you actually use. An old MX record left behind sends some mail to the wrong place.
SPF: who may send for you
SPF is a TXT record on the domain itself:
example.co.za. TXT "v=spf1 a mx ~all"
This says "the servers in my A and MX records may send mail for me; treat anything else with suspicion". If another service sends mail as you (your accounting system, a newsletter tool, your website's contact form), add it with the include: value that service gives you.
Three rules people often miss:
- Only one SPF record per domain. Two SPF records make both invalid. Merge them into one.
- At most 10 DNS look-ups. Each
include:costs at least one. Too many and SPF fails. - End with
~allor-all. Never+all, which lets anyone send as you.
DKIM: a signature on every message
DKIM is a TXT record on a special name that includes a "selector":
default._domainkey.example.co.za. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."
The long p= value is a public key. Your mail server signs each message with the matching private key, and receiving servers check the signature. Copy the value exactly: one missing character breaks it. Each service that sends mail for you should have its own DKIM key.
DMARC: the policy and the reports
DMARC is a TXT record on _dmarc:
_dmarc.example.co.za. TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.co.za"
The p= part is the policy:
| Policy | What receivers do with failing mail | When to use it |
|---|---|---|
p=none | Deliver it as normal, but report it | First few weeks: see who sends as you |
p=quarantine | Put it in spam | Once all your real mail passes |
p=reject | Refuse it | When you're confident, for the strongest protection |
Start with none, read the reports, fix any real sender that fails, then tighten the policy step by step.
How to check your records
On Windows (Command Prompt or PowerShell):
nslookup -type=mx example.co.za
nslookup -type=txt example.co.za
nslookup -type=txt _dmarc.example.co.za
On macOS or Linux:
dig +short MX example.co.za
dig +short TXT example.co.za
dig +short TXT _dmarc.example.co.za
dig +short TXT default._domainkey.example.co.za
DNS changes can take a few hours to be seen everywhere, so check again later if a new record doesn't show yet.
Common mistakes
- Two SPF records after adding a new service
- Forgetting the website's contact form, so its mail fails SPF
- A DKIM value broken across lines when it was pasted
- Jumping straight to
p=rejectand losing real mail - MX records still pointing at an old provider after a move
For the bigger picture, read Email that lands in the inbox. Need a hand? Contact support on the support page.