Email Spam Spanish version

How to Configure SPF So Your Emails Don't Go to Spam (SPF)

Configure the SPF record on your domain to prevent your emails from going to spam: what it is, how to create it and add it to DNS.

Published: 12/07/2026 Updated: 12/07/2026
In this article

Introduction

If your emails go to your customers’ spam folder, one of the most common causes is not having the SPF record configured. SPF is one of three technologies (along with DKIM and DMARC) that prove to Gmail, Outlook and other providers that your emails are legitimate.

In this article you’ll see what SPF is, how to create it and how to configure it on your domain.

What SPF is

SPF (Sender Policy Framework) is a DNS record listing the servers authorized to send email from your domain. It’s like a guest list: if a server isn’t on the list, providers distrust the email.

How it works

  1. You send an email from info@yourdomain.com.
  2. The email arrives at Gmail.
  3. Gmail checks the SPF record of yourdomain.com.
  4. If the sending server is on the SPF list, the email passes.
  5. If it’s not, Gmail marks it as suspicious (and may send it to spam).

Without SPF, Gmail and Outlook have no way to verify that the email claiming to come from your domain really comes from you. That’s why they send it to spam.

How to create an SPF record

An SPF record is a TXT type record in your domain’s DNS. It has this format:

v=spf1 include:_spf.mihosting.com ~all

Explanation:

  • v=spf1: indicates it’s an SPF record.
  • include:_spf.mihosting.com: authorizes miHosting’s servers.
  • ~all: other servers aren’t authorized (soft fail).

If you use other services to send email (Mailchimp, SendGrid, etc.), you must add them to the SPF too with include.

How to configure SPF on your domain

If your domain is at miHosting

  1. Log in to cPanel or your domain’s DNS management panel.
  2. Go to Zone Editor or DNS Zone Editor.
  3. Add a TXT type record:
    • Name: yourdomain.com. (or @).
    • Type: TXT.
    • Value: v=spf1 include:_spf.mihosting.com ~all.
  4. Save.

On miHosting hosting plans, SPF usually comes preconfigured. If you don’t have it, open a ticket and we’ll configure it.

If you use external services

If you send email from several services, add them all:

v=spf1 include:_spf.mihosting.com include:spf.mailchimp.com include:sendgrid.net ~all

Don’t put more than 10 include queries in an SPF. If you need more, simplify.

SPF vs DKIM vs DMARC

TechnologyWhat it doesDifficulty
SPFLists authorized serversLow
DKIMSigns emails with cryptographic keyMedium
DMARCDefines what to do if SPF or DKIM failMedium

The three are complementary. For maximum deliverability, configure all three. You have guides for each in our knowledge base.

Useful tips

  • Use ~all, not -all. Soft fail (~) is safer to start. Hard fail (-) rejects email from unlisted servers, which can cause losses if you forget a server.
  • Don’t exceed 10 includes. SPF has a limit of 10 DNS queries. If you exceed it, SPF stops working.
  • Add all services that send email for you. Hosting, Mailchimp, SendGrid, Gmail (if you use Google Workspace), etc.
  • Review SPF after switching providers. If you switch hosting, update SPF.
  • Check it works. Use mxtoolbox.com to verify your SPF.

Common problems

My emails still go to spam after configuring SPF

SPF is only one part. Configure DKIM and DMARC too. Also, review email content and your sending reputation.

SPF too many DNS lookups

You have more than 10 includes. Simplify: use services that group or remove the ones you don’t use.

SPF doesn’t propagate

DNS changes take between minutes and 48 hours to propagate. Wait and check again.

I don’t know which services to include

Think about everything that sends email with your domain: your hosting, your newsletter, your CRM, Google Workspace if you use it.

Frequently asked questions

Is SPF mandatory?

It’s not mandatory by law, but Gmail and Outlook practically require it to not send your email to spam.

Can I have several SPF records?

No. Only one SPF record per domain. If you need to authorize several services, put them all in the same record with include.

Does SPF cost money?

No, it’s free. It’s just a DNS record.

Does my hosting have SPF by default?

At miHosting, most plans have it preconfigured. Check with mxtoolbox or ask support.

Does SPF protect against phishing?

Partially. It prevents someone from using your domain from unauthorized servers. But for complete protection, combine with DKIM and DMARC.

SPF: the first layer of deliverability

SPF is the foundation of email authentication. Without it, your emails are much more likely to go to spam. Configuring it is free and takes five minutes.

If you need help configuring SPF on your miHosting domain, open a ticket from your client panel.