Domain and email: the technology under the website
Operations and securityUnder every website lies a domain, and on that domain hang records that have nothing to do with the website — but a great deal to do with whether your emails arrive and whether someone can write in your name.
5 min read
By Timo Wessels Published
Under every website lies a domain. Entries hang on it that have nothing to do with the website. They help decide, though, whether your emails arrive and whether someone can write in your name.
Three entries in the DNS (the internet’s address book) are central:
- SPF decides which servers may send mail for your domain.
- DKIM signs outgoing mail digitally.
- DMARC joins the two and tells recipients what to do with mail that fails.
The most important points first:
- Without these entries anyone can send a mail that looks as if it came from your address.
- A DMARC entry with
p=nonelooks configured and prevents nothing. - An SPF entry must not trigger too many lookups, or it fails completely.
Why it matters
Without these entries someone can send an email that looks as if it came from you. That is the basis of most fraud mail in business: for example, an invoice with a changed account number, supposedly from you. In the other direction, your own mails land in spam, because the recipient cannot check whether they are genuine. Google requires senders to secure their domain with SPF, DKIM and DMARC, and recommends always doing so.
DMARC with p=none
The most common finding in practice is a DMARC entry with p=none. It looks configured but prevents nothing. The standard (RFC 7489) says such an entry should not change how the mail is handled. It only tells the recipient: observe and report.
Unless somebody reads the reports, that is pure show. The path is still right: first p=none, then read the reports for a while, fix every legitimate misconfiguration, then p=quarantine (sort out suspicious mail) and finally p=reject (turn it away). The mistake is not starting at p=none but getting stuck there. That is my order from practice.
SPF and the limit of ten lookups
A mistake you cannot see in the SPF entry: evaluation may trigger at most ten DNS lookups. So it says in RFC 7208. Every include fetches another entry and counts, even if that one in turn refers to others. If the limit is exceeded, the check reports a permanent error (permerror).
The entry reads perfectly fine. The limit is exceeded by adding one more service to an entry that is already full. Then the SPF entry no longer protects.
Two notes
DKIM cannot be checked from outside. The key lies under a name nobody can guess. If a report says nothing about it, that means “not checked” and not “missing”.
There are further procedures, for example DANE, MTA-STS and TLS reporting, which like to show red in audit reports. They depend on DNSSEC and on entries the mail provider has to publish. Those are properties of the hosting and not omissions of the website. I do not report them as errors. A category that is red in every report is soon skipped by the reader, and with it the real findings beside it.
The domain itself
When does it expire? Is it locked against transfer? Is more than one name server entered? If there is only one, the domain has no protection against failure.
How to check it yourself
With an online tool: MXToolbox (mxtoolbox.com) checks SPF and DMARC. For SPF it shows the number of lookups, which has to stay under ten.
Read the DMARC value: Look at the value p=. If it says none, the entry is there but ineffective.
On the command line:
dig +short txt yourdomain.com
dig +short txt _dmarc.yourdomain.com
The practical test: Send yourself a mail from your business address to a Gmail address. There, open “Show original” in the details. At the very top it says whether SPF, DKIM and DMARC passed.
What you can do if it is missing
1. Set up DKIM first, before SPF. SPF checks which server a mail comes from. If it passes through forwarding, that can be a different one, and SPF fails. The DKIM signature is built to survive small changes on the way (RFC 6376). For the later switch to p=reject, DKIM is therefore the more reliable route. That is my assessment from practice.
2. Set a DMARC entry with p=none and an address for the reports, read the reports and work your way up.
3. Do not forget sp=. Without this statement subdomains inherit the main rule. A rule of its own for subdomains closes the gap through which someone could forge invoice.yourdomain.com.
4. If your SPF entry is close to ten lookups, throw out the services that do not have to be in it. Many marketing providers send through their own sender domain and need no entry at yours. The line is then a wasted lookup. The next step would be to put newsletters and transactional mail on subdomains of their own. Each subdomain has its own SPF entry and so its own budget of ten.
5. Secure the domain: switch on the transfer lock, automate renewal and enter at least two name servers. That is three clicks at the registrar and the cheapest protection against failure.
Sources
- IETF, RFC 7208: Sender Policy Framework — at most ten lookups per evaluation,
includefetches further entries, a permanent error when exceeded: rfc-editor.org(external site: rfc-editor.org) - IETF, RFC 6376: DomainKeys Identified Mail — digital signature, deliberately built to survive small changes in transit: rfc-editor.org(external site: rfc-editor.org)
- IETF, RFC 7489: DMARC — policies
none,quarantine,reject;p=nonedoes not change how mail is handled; subdomains inherit the policy unless one is set: rfc-editor.org(external site: rfc-editor.org) - Google Workspace Help, Email sender guidelines — set up SPF, DKIM and DMARC for the domain: support.google.com(external site: support.google.com)
- Own testing practice — the order
p=nonetop=reject, DKIM first, not reporting DKIM as missing, DANE, MTA-STS and TLS reporting as properties of the hosting, name server redundancy and transfer lock, moving newsletters to subdomains.