This document contains information to protect your domain against identity spoofing, configuring SPF, DKIM and DMARC so that no one can send fake emails on behalf of your mailboxes.
Identity spoofing (spoofing) occurs when someone sends emails that appear to come from your domain, for example from ventas@tudominio.com, without using your server. With SPF, DKIM and DMARC well configured, the servers that receive those fake emails can reject them or send them to spam.
How do I notice that they are spoofing my domain?
- You receive bounces or replies from emails that you never sent.
- Clients or suppliers notify you that they received strange messages with your address.
- Your legitimate emails start going to spam, because the domain lost reputation.
If your emails go out with your domain but do not appear in the Sent folder, they probably did not come from your account. Anyway, change the password of that mailbox just in case.
Before you start: confirm that DKIM and SPF appear as Valid in cPanel, in Email → Email Deliverability. The step by step is in the article DomainKeys for email sending.
Step 1: harden SPF
The SPF record that cPanel creates ends in ~all, which asks the recipient to distrust unauthorized servers, but without rejecting them. To have it reject them, change it to -all:
- Open Domains → Zone Editor and click Manage next to the domain.
- Find the TXT record that starts with
v=spf1and edit it. - If you send email from other services (a mailing system, Google Workspace, your online store), add them with
include:, as indicated by each provider. - Change the ending
~allto-alland save.
Important: with -all, any server not listed in the SPF is rejected. Before changing it, make sure you have included all services that send email with your domain. If not, those emails stop arriving.
Step 2: activate DMARC protection
DMARC is what actually tells the recipient what to do with a fake email. Raise the policy gradually:
- Monitoring: start with
p=none. Emails are not blocked and you receive reports in the mailbox ofrua=. - Quarantine: after a few weeks without problems with your legitimate email, switch to
p=quarantine. Fake emails go to spam. - Rejection: when you are sure, switch to
p=reject. Fake emails are rejected and do not arrive.
Example of TXT record _dmarc.tudominio.com with rejection:
v=DMARC1; p=reject; rua=mailto:postmaster@tudominio.com
Step 3: check an email
- Send an email from your mailbox to a Gmail account.
- In Gmail, open the message, click the three dots and choose Show original.
- Check that SPF, DKIM and DMARC say PASS.
Frequent problems
- I keep receiving bounces of emails I didn't send: they may keep arriving for a few days, while servers apply your new policy. If they persist with
p=reject, open a ticket. - After switching to
-allorp=reject, some legitimate emails don't arrive: they come from a service that is not in the SPF. Add it withinclude:or temporarily revert to~allandp=none. - I use another company's DNS: the records work the same, but you have to create and edit them in that company's panel, not in cPanel.
- DMARC reports arrive in compressed files difficult to read: this is normal. You can use a free DMARC report analysis service to view them in summary form.
If you believe your domain is being spoofed and you need help setting up protection, open a ticket from the client portal or consult via the site's online chat.
