Step by step
How to set up SPF, DKIM and DMARC so email from your company domain stays out of spam
Intermediate · 45 minutes of work · 2 minute read · Updated October 21, 2026
Anyone can send a message that pretends to come from your domain. That is why mail servers (Gmail, Outlook and others) check whether the sender is allowed to. Missing SPF, DKIM and DMARC is the most common reason contact-form emails or offers end up in spam.
What each of the three records does
- SPF: the list of servers allowed to send mail from your domain.
- DKIM: a digital signature on the message. The recipient checks it with the public key in your DNS.
- DMARC: an instruction telling the recipient what to do with a message that fails SPF and DKIM, plus an address to send reports to.
1. SPF
Add a TXT record at the root of the domain. Your mail provider gives the exact value. Example for Google Workspace:
v=spf1 include:_spf.google.com ~all
Two rules: a domain may have only one SPF record (combine several providers in one record with further include: entries), and the whole record may not require more than 10 DNS lookups.
2. DKIM
You generate the key in your mail provider's panel. You get a record name (the selector, for example google._domainkey) and a long key value. Add it as a TXT record in DNS and switch signing on in the provider's panel. If the website form or a newsletter tool also sends mail, each of them has its own DKIM key to add.
3. DMARC
Add a TXT record named _dmarc. To start:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
p=none blocks nothing and only collects reports. After a few weeks, once the reports show that all legitimate mail passes, move to p=quarantine and later p=reject.
4. Check that it works
Send a message to a Gmail mailbox, open it and choose “Show original”. SPF, DKIM and DMARC should all say PASS. If one says FAIL, the usual cause is a missing include: in SPF or a DKIM key that was not enabled on the provider's side.
DNS and mail setup gets tedious when there are several senders. If you prefer to hand it over, see domain management and technical support.
Table of contents
Have this problem? Copy an AI prompt that solves it
Paste it into ChatGPT, Claude or Gemini. The assistant will ask about your situation and walk you through it step by step.
You are an email deliverability specialist. Help me set up SPF, DKIM and DMARC for my domain so my email stays out of spam. First ask me for: - the domain name, - my mail provider (for example Google Workspace, Microsoft 365, hosting email), - every system that sends mail on behalf of the domain (website form, newsletter, CRM, shop), - who manages my DNS, - my current TXT records (ask me to paste them). Then give me the exact records to add (type, name, value). Remember: a domain may have only one SPF record, and the record may not require more than 10 DNS lookups. Start DMARC with p=none and a reporting address. Do not invent DKIM key values; tell me where to generate them at my provider. Finally explain how to verify the result (for example in Gmail: Show original), what to look for in DMARC reports, and when it is safe to move to p=quarantine and then p=reject. After each step wait for my confirmation.
Frequently asked questions
Services related to this guide
Keep reading
Intermediate · 90 minutes of work
Jak przygotować wiedzę o firmie, żeby asystent AI odpowiadał klientom poprawnie
Jakość asystenta AI zależy od materiałów, na których pracuje. Jak zebrać, uporządkować i aktualizować wiedzę o firmie w 6 krokach.
Intermediate · 60 minutes of work
Jak zautomatyzować obsługę zapytań ofertowych z formularza za pomocą AI
Krok po kroku: formularz, narzędzie automatyzacji i AI, które przygotowuje szkic odpowiedzi do Twojej akceptacji. Bez wysyłania czegokolwiek bez kontroli.
Basic · 15 minutes of work
Jak napisać prompt do ChatGPT lub Claude, żeby dostać odpowiedź, której możesz użyć w pracy
Sprawdzony schemat promptu w 5 krokach: rola, kontekst, zadanie, format i ograniczenia. Z gotowym przykładem do skopiowania.
Would you rather have someone do it for you?
Describe what you want to achieve in a brief. We reply with specifics, no sales call.
Send a brief