How to improve email security with an SPF record

View as Markdown

Find out how to configure an SPF record on your domain name to improve email security

Objective

The SPF (Sender Policy Framework) allows the server that receives an email to check that it has been sent from a trusted server.

Why set up the SPF record for your emails?
  • It helps prevent potential identity theft via email addresses using your domain name (spoofing).
  • You can also use it to authenticate the emails you send.
  • The SPF record is added as a record in the domain name’s DNS zone.

This action is made possible by the information entered in an SPF record, which is actually a TXT record in the DNS zone. We can find:

  • Server and/or multiple IP addresses: This will identify them as legitimate sending sources.
  • A qualifier: It will recommend to the server receiving the emails a way to react to a message considered illegitimate, that is to say from a source that is not listed.

You should therefore ensure that you enter the sending sources you use to send emails with your domain name in the SPF record. These sources can be your own email server, that of your provider, or one of OVHcloud’s email solutions.

Example

You are sending an email from your address contact@mydomain.ovh. Only outgoing server A is declared in the SPF record of the domain name mydomain.ovh. When the Inbound Mail Server receives the email, it will read the DNS zone of your domain name mydomain.ovh to inspect the SPF record.

  • Outgoing Mail Server A is listed in the SPF record, so the email will arrive normally in the recipient's inbox.
  • Outgoing Mail Server B is not listed in the SPF record, so the email sent from this server will be marked as suspicious in the inbox. This can result in [SPAM] being added in the subject of the email, being placed in a Junk mail folder, or being deleted directly, depending on the rules of the receiving server.
domain
Info

The SPF record is only an indication provided to servers that receive emails, including yours. It is up to these servers to apply, or not, what is specified in the SPF record of domain names for which they receive messages.

Find out how to configure an SPF record for your domain name at OVHcloud.

Requirements

  • The domain name concerned must use the OVHcloud configuration (i.e. the OVHcloud DNS servers).

OVHcloud Control Panel Access

  • Direct link:
  • Navigation path: Web Cloud > Domain names > select your domain name > DNS zone tab

Warning

If your domain name does not use OVHcloud DNS servers, you will need to modify the SPF record using the interface of the service provider managing your domain name's DNS.

If your domain name is registered with OVHcloud, you can check if it is using the OVHcloud configuration in your . Click on the DNS servers tab of your domain name.

Instructions

Checking your current SPF configuration

If your domain name uses OVHcloud DNS servers, you can check if an SPF record is already configured for it.

How do I check an existing SPF configuration?

Log in to the and switch to Web Cloud in the top navigation bar. In the Domain names section, select the domain name concerned. Click on the DNS zone tab.

The table on this page displays your domain name's DNS zone at OVHcloud. Each DNS record is represented by one line in the table.

Info

In case of doubt, verify that your domain name is actually using OVHcloud DNS servers from the DNS servers tab.

To find the row for the OVHcloud SPF record, apply a display filter to the table with the Filter button. Since the record can appear in two different places, filter on both the TXT and the SPF type. You will get one of the following results.

  • An SPF record that corresponds to OVHcloud email solutions is displayed: Your domain name currently uses the OVHcloud configuration. If you no longer wish to use it, you must modify it in the next step.

  • An SPF record that does not match the OVHcloud configuration is displayed: Your domain name already uses a custom SPF. If your configuration is incorrect, you will need to modify it. You can modify it or choose the OVHcloud configuration in the next step.

  • An SPF record does not appear in the target column: First check that the record does not actually exist as SPF or TXT by changing the filtering. If no SPF record is displayed in the zone at all, your domain name does not use one. You can add it in the next step.

Info

An SPF record always follows this form: "v=spf1 sources qualifier". For example, the OVHcloud SPF is: "v=spf1 include:mx.ovh.com ~all".

Configuring a new SPF record

Click Add an entry above the table and select the SPF type. A form opens where you build your SPF record field by field.

Adding an SPF record from the DNS zone
  • Subdomain: leave it empty (or set @) to apply the SPF to the whole domain name, or enter a subdomain if you only send emails from one.
  • Authorisation mechanisms: tick the sources that are allowed to send emails for your domain name.
    • Include OVH email servers: authorises all of the OVHcloud outgoing email servers at once. Tick this if you use an OVHcloud email solution.
    • Allow domain MX servers (mx): authorises the servers that receive your emails to also send them.
    • Allow the domain's IP address (a): authorises the server that hosts your domain name (useful when your website and emails share the same IP address, for example on a dedicated server).
  • Additional servers to authorise (include): add the SPF domains of other providers that send emails on your behalf (marketing platform, CRM, etc.), so their servers are treated as legitimate.
  • Authorised IPv4 addresses (ip4) and Allowed IPv6 addresses (ip6): add specific IP addresses or blocks authorised to send emails.
  • SPF Policy: choose how receiving servers should treat an email sent from a source that is not listed (see our recommendation below).
  • TTL: leave it on By default or set a value.

The Overview of the SPF record box shows the record being built as you fill in the fields. Once you are done, click Add.

Tip

Both the ~all and -all SPF Policy values are valid, but for the best protection we strongly recommend -all, which asks the servers receiving your emails to reject any message sent from a source that is not listed in your SPF record.

Only choose -all once you are sure your record lists every legitimate sending source: your OVHcloud email solution, but also any third party that sends emails on your behalf (marketing platform, CRM, ticketing tool, etc.). If a legitimate source is missing, its emails will be rejected. If you are not certain the list is exhaustive, use ~all, which flags those emails as suspicious instead of rejecting them.

Info

For an OVHcloud email solution, the minimum SPF record is simply the Include OVH email servers box ticked — this produces v=spf1 include:mx.ovh.com ~all (see OVHcloud SPF configuration for shared email offers).

If you already have the complete SPF string (provided by your email service) or you need a tag that the form does not expose, you can enter it directly: select the TXT type instead of SPF and paste the full v=spf1 … value in the Value field, or use the Advanced editing mode.

Info

It can take between 4 and 24 hours until the configuration is fully effective.

Modifying an SPF record

Log in to the and switch to Web Cloud in the top navigation bar. In the Domain names section, select the domain name concerned. Click on the DNS zone tab.

The table on this page displays your domain name's DNS zone at OVHcloud. Each DNS record is represented by a line in the table. Locate your TXT or SPF record in this table, open its actions menu and click Edit the entry.

Refer to the guide section above if you need more information about the SPF fields.

OVHcloud SPF configuration for shared email offers

The general OVHcloud SPF configuration applies to the solutions below:

The configuration is as follows:

mydomain.ovh IN TXT "v=spf1 include:mx.ovh.com ~all"

OVHcloud SPF configuration for Private Exchange

For the Private Exchange solution, you need to enter your email server’s IP addresses. To do this, use the ip4 argument to enter the IPv4 address (A) and the ip6 argument for the IPv6 address (AAAA) of your Private Exchange server.

mydomain.ovh IN TXT "v=spf1 ip4:203.0.113.099 ip6:2001:db8:88:b999::1000:2233 ~all"

If you also use a shared email service, you can add the argument include:mx.ovh.com to the SPF record, with the following result:

mydomain.ovh IN TXT "v=spf1 ip4:203.0.113.099 ip6:2001:db8:88:b999::1000:2233 include:mx.ovh.com ~all"
How do I retrieve the IP addresses of a Private Exchange server?

To retrieve the IP address of the Private Exchange server, click Microsoft, then Exchange. Next, click on the name of the Private Exchange service concerned.

In the General Information tab, click on the A and AAAA in the Server Diagnostics section. In the window that appears, read the value.

domain

If the boxes A and AAAA are green, you will not see the IP addresses by clicking on them. You will need to retrieve this information from the DNS zone for the domain name attached to your Private Exchange platform. To do this, retrieve the webmail link from the General information tab, in the Connection box.

domain

Go to the Domain names section, select the domain name attached to your private Exchange platform, then click on the DNS zone tab. Retrieve the IPv4 (record A) and IPv6 (record AAAA) addresses corresponding to the webmail URL.

Go further

Editing an OVHcloud DNS zone

Editing the DNS servers for an OVHcloud domain name

Join our community of users.

Was this page helpful?