How do I add an SPF record?

Avoid having your emails going to spam by adding an SPF record to your domain’s DNS settings.

Yuan Wang avatar
Written by Yuan Wang
Updated this week

What the heck is DNS or SPF?! If that's your first thought, be warned that you may need some time (or help) to wrap your head around this.

This tutorial is for you if:

  • You connected your email via Gmail and SMTP Server in Email Settings.

  • You have a custom email hosting provider, like Bluehost, Dreamhost, GoDaddy, Hostgator, Hostinger, Google Workspace, etc.

This tutorial is NOT for you if:

  • You connected your email via Default Server in Email Settings.


Understanding DNS records

Before we begin, it's useful to understand the acronyms:

  • DNS stands for "Domain Name System". DNS is the phonebook of the Internet and is responsible for converting domains (e.g. studioninja.co, yourphotographycompany.com) into Internet Protocol (IP) addresses (e.g. 173.194.39.78).

  • Domain Name System (DNS) records are used to provide specific, important details for your domain. The simplest way to understand how DNS records work is to think of it as a phonebook listing.

    • Domain name servers = like a phonebook

    • Domain = like a name listing

    • DNS records = like phone numbers and addresses within the listing

    A DNS record and the information contained within provide sufficient data to route your domain’s traffic accordingly.

  • Sender Policy Framework (SPF) records, which are one type of DNS records, specify what mail servers are permitted to send email from your domain. By adding an SPF record, you will be telling your domain that Studio Ninja's mail server is allowed to send emails from your domain, thus marking any emails you send from Studio Ninja as legitimate (i.e. not fake or phishing). This reduces the risk of such emails going to your recipients' spam or junk mailbox.

  • DomainKeys Identified Mail (DKIM) proves the legitimacy of the email sender. Receiving servers use DKIM to verify that the domain owner actually sent the message.

  • Domain-based Message Authentication, Reporting, and Conformance (DMARC) gives you great visibility and reports into who is sending emails on behalf of your domain, ensuring only legitimate emails are received. It lets you tell receiving servers what to do with messages from your domain that don’t pass SPF or DKIM.


Find help articles written by your provider

Next, try searching for a helpful article on adding SPF records that are written specifically by your domain hosting provider. Here are some examples:


Common steps

If you have a custom email hosting provider, you will need login access to your domain provider's DNS management interface to add an SPF record.

Here are common steps encountered when adding an SPF record but they may not match yours exactly because the DNS management interface will behave differently for different providers.

  1. Login - Login to your cPanel or account.

  2. Go to the DNS Zone Editor - This is where you can manage your DNS records. It can also be called DNS, DNS Management, etc.

    Note: If you cannot locate your DNS Zone Editor, please contact your provider.

  3. Add a DNS record.

  4. Choose "TXT" if you are asked what type of DNS record you're adding.

  5. You may encounter such input fields:

    1. Name - Enter your domain name or leave it blank

    2. Type - Choose "TXT"

    3. TTL - Enter "3600" or "1 hour"

    4. Value (can also be Record Value, TXT Value, etc) - Copy and paste the value as shown in your Studio Ninja account's SPF Record Checker popup:

      (Skip to the Google Workspace section if you have a Google account with a custom domain provider.)


      Note: The image above is an example. The value that you should use is unique to your account. Please refer to your own account's SPF Record Checker by going to Settings > Email Settings > SMTP Server. (For SMTP server - Custom option only)

      For Microsoft email accounts, create or add this value to your SPF record:

      v=spf1 include:spf.protection.outlook.com include:spf.studioninja.co ~all

  6. To save this record, click "Add Record" or "Save".

  7. After adding an SPF record, it may take up to 24 hours for SPF authentication to start working. Studio Ninja will check your SPF record every 15 minutes and inform you once it’s been found.


Google Workspace (formerly G Suite)

If your email is powered by Google Workspace (formerly known as G Suite), you may also have a custom domain e.g. janedoephotography.com. Google now recommends setting up SPF and/or DKIM, and DMARC authentication methods. Click here to read about the new email sender guidelines of Google in 2024.

To reduce the risk of your emails going to spam:

  1. Add an SPF record in your domain provider's DNS management area with the following value:

    v=spf1 include:_spf.google.com include:spf.studioninja.co ~all


    However, if you already have an existing record, make sure your record contains "include:spf.studioninja.co" as part of the value.

  2. Authenticate your emails with DKIM authentication via Google Admin Console:

    1. Log in

    2. Go to Apps > Google Workspace > Gmail > Authenticate Email

    3. Generate a code and enter the hostname + TXT record value into your DNS TXT record with your domain provider (same place as the above SPF record)

    You will have two TXT records (one SPF, one DKIM) added to your domain provider's DNS management area.

  3. For DMARC, the DKIM and SPF should be authenticating messages for at least 48 hours before turning it on. We recommend contacting your domain host provider to help set it up or check this Google article for more info.


Help! I'm lost.

At any point, if you're unsure what to do, please contact your domain hosting provider to ask for help. They can also help you add an SPF record that contains the TXT value as shown in the SPF Record Checker popup in your Studio Ninja account's Email Settings (if your email is connected via SMTP Server).

Other ways to avoid emails going to spam

If you've added a valid SPF record successfully, and you are still having issues with emails going to spam, there are other steps you can take, like sending SMS, etc. Click here to learn more about other methods.

Did this answer your question?