Skip to content
HostingSquad
To websitehostingsquad.nl
Search
EN

How do I set up an SPF record?

Updated on

An SPF record (Sender Policy Framework) is a DNS record that states which servers may send email on behalf of your domain name. It helps prevent spam and phishing that misuses your domain name. Large email providers such as Gmail and Outlook.com set requirements for SPF: if the record is missing or incorrect, your email may end up in the spam folder or be rejected.

Before you start

  • You need your DirectAdmin login details.
  • DirectAdmin is in English by default, so the menus and buttons in this article are named as you see them on screen. If your DirectAdmin is set to Dutch, DirectAdmin may show the Dutch names, such as Accountbeheer instead of Account Manager and DNS Beheer instead of DNS Management.
  • If you use external name servers, your SPF record is not in DirectAdmin but with your DNS provider, and a change in DirectAdmin has no effect. In that case, you change the record with that provider; it must still contain include:mail-filter.nl.

What should the record contain?

Email that you send from a HostingSquad web hosting package or VPS goes through our external spam filter mail-filter.nl. That is why your SPF record must contain include:mail-filter.nl. A correct SPF record looks like this, for example:

v=spf1 a mx include:mail-filter.nl ~all

Do you also send email on behalf of your domain name through other services, such as a newsletter tool, a CRM package or an external SMTP service? Then add them to the same record, using the include that the service itself provides. For SendGrid, it looks like this:

v=spf1 a mx include:mail-filter.nl include:sendgrid.net ~all

What you need to do depends on your package. With a web hosting package, include:mail-filter.nl is already in your SPF record by default. With a VPS, you add it yourself.

Web hosting: only add to it for another sender

With a web hosting package, your SPF record is already correct. It looks roughly like this, with the IP addresses of your server in place of the dots:

v=spf1 a mx ip4:… include:mail-filter.nl ip6:… ~all

You only need to do something if you also send email through another service. In that case, add that service's include.

  1. Log in to DirectAdmin

  2. Open DNS Management

    Under Account Manager, click DNS Management.

  3. Choose your domain name

    If you manage more than one domain name, choose uwdomeinnaam.nl.

  4. Find the SPF record

    Find the line of type TXT whose value starts with v=spf1. If there is none, continue with "No SPF record? Add one" below.

  5. Open the record

    In that line, click Edit. The Edit Record window opens. The TXT Record Type drop-down list is set to SPF; choose Plain: you then edit the whole record as text in the Value field.

  6. Add the other service's include

    In the Value field, type the include that the service provides before the last part (~all or -all), with a space before and after it. Leave the other parts as they are, including include:mail-filter.nl; if it is missing, type it in the same way. For SendGrid, a record like this:

    v=spf1 a mx ip4:… include:mail-filter.nl ip6:… ~all

    therefore becomes:

    v=spf1 a mx ip4:… include:mail-filter.nl ip6:… include:sendgrid.net ~all
  7. Save the change

    Click Save.

VPS: add include:mail-filter.nl

DirectAdmin creates an SPF record itself when a domain name is added, but on a VPS it does not contain include:mail-filter.nl by default. This is how you check the record and add the include.

  1. Log in to DirectAdmin

  2. Open DNS Management

    Under Account Manager, click DNS Management.

  3. Choose your domain name

    If you manage more than one domain name, choose uwdomeinnaam.nl.

  4. Find the SPF record

    Find the line of type TXT whose value starts with v=spf1. If there is none, continue with "No SPF record? Add one" below.

  5. Open the record

    In that line, click Edit. The Edit Record window opens. The TXT Record Type drop-down list is set to SPF; choose Plain: you then edit the whole record as text in the Value field.

  6. Add include:mail-filter.nl

    If include:mail-filter.nl is not yet in the Value field, type it before the last part (~all or -all), with a space before and after it. Leave the other parts as they are. A record like this:

    v=spf1 a mx ip4:… ~all

    therefore becomes:

    v=spf1 a mx ip4:… include:mail-filter.nl ~all

    Put the includes of any other services that send email for you in this same line.

  7. Save the change

    Click Save.

No SPF record? Add one

DirectAdmin normally creates this record itself. If it is missing, something probably went wrong when the domain was created. You can then add the record yourself.

  1. Log in to DirectAdmin

  2. Open DNS Management

    Under Account Manager, click DNS Management.

  3. Choose your domain name

    If you manage more than one domain name, choose uwdomeinnaam.nl.

  4. Add a TXT record

    Click Add Record and, under Record Type, choose TXT.

  5. Fill in the record

    Under Name, leave the domain name as it is (uwdomeinnaam.nl.). Under Value, type the record, for example v=spf1 a mx include:mail-filter.nl ~all.

  6. Save the record

    Click Add.

Not working?
  • Are there two lines starting with v=spf1? Merge them into one line and delete the other.
  • Write an include without a space after the colon: include:sendgrid.net, not include: sendgrid.net. With a space, the whole record is invalid.
  • An SPF record may cause at most ten DNS lookups during the check. Every include, a, mx, ptr, exists and redirect counts, including those inside an include. Beyond that, the record is invalid.

Still stuck? Contact us (in Dutch).

Related articles