How to Add an SPF Record in Vercel

Step-by-step guide to adding SPF records in Vercel DNS. Learn when to use Vercel DNS vs your registrar and how to create SPF TXT records.

Vercel is a popular hosting platform for Next.js and other modern web frameworks. Like Netlify, Vercel offers basic DNS management for domains connected to the platform. If your domain's nameservers point to Vercel, you can add SPF records through their dashboard. But here's the thing most Vercel users need to know: the majority of Vercel users manage DNS at their domain registrar, not through Vercel. This guide covers both scenarios and helps you figure out where to add your SPF record.

Do You Actually Manage DNS Through Vercel?

This is the first question to answer. Many Vercel users connect their domain to Vercel for hosting but keep DNS management at their registrar -- Cloudflare, Namecheap, GoDaddy, or wherever they bought the domain. In that case, you'd add your SPF record at the registrar, not in Vercel.

To check: look at your domain's nameservers. If they point to Vercel's nameservers (like ns1.vercel-dns.com and ns2.vercel-dns.com), you're using Vercel DNS. If they point to your registrar's nameservers, that's where you manage DNS -- including SPF.

If you connected your domain to Vercel using a CNAME or A record (rather than changing nameservers), your DNS is still managed at your registrar. Add your SPF record there, not in Vercel.

Why SPF Matters

Regardless of where you host your website, if your domain sends email, it needs an SPF record. SPF is a DNS TXT record that tells receiving mail servers which services are authorized to send email from your domain. Without it, your emails from Google Workspace, Microsoft 365, SendGrid, or any other provider are more likely to end up in spam or get rejected.

SPF is the first layer of email authentication, as defined in RFC 7208, and takes only a few minutes to configure.

Step-by-Step: Adding an SPF Record in Vercel DNS

1

Log in to Vercel

Go to vercel.com and sign in to your account.

2

Navigate to your domain's DNS settings

Go to the Domains section (accessible from the top navigation or your project settings). Find your domain and click on it. Then look for the DNS Records section (see Vercel's DNS documentation for details), which lists all records managed through Vercel.

3

Check for existing SPF records

Scroll through the records and look for any TXT record with a value starting with v=spf1. If one exists, you'll need to update it rather than creating a second one.

4

Add a new DNS record

Click Add (or "Add Record"). Set the Type to TXT. In the Name field, leave it blank for the root domain. In the Value field, paste your SPF record -- for example: v=spf1 include:_spf.google.com -all. Click Add to save.

5

Verify the record is live

Vercel DNS changes typically propagate within a few minutes. Check your record at SPF Record Check to confirm it's published and valid.

A Note on the Name Field

In Vercel's DNS interface, leave the Name field blank for root domain records. Vercel automatically associates records with no name to the root domain. Don't enter @ -- Vercel may not interpret it the same way as registrars like Cloudflare or GoDaddy. If you enter a subdomain name, the SPF record will only apply to that subdomain, not your main domain.

SPF Record Examples

Here are ready-to-use SPF records for common email configurations. These work regardless of whether you're adding them in Vercel DNS or at your registrar.

Google Workspace Only

Use the _spf.google.com include for Google Workspace:

v=spf1 include:_spf.google.com -all

Microsoft 365 Only

Use the spf.protection.outlook.com include for Microsoft 365:

v=spf1 include:spf.protection.outlook.com -all

Google Workspace + SendGrid

v=spf1 include:_spf.google.com include:sendgrid.net -all

Microsoft 365 + Mailchimp

v=spf1 include:spf.protection.outlook.com include:servers.mcsv.net -all

Google Workspace + Amazon SES

v=spf1 include:_spf.google.com include:amazonses.com -all
SetupSPF RecordEst. Lookups
Google Workspacev=spf1 include:_spf.google.com -all~3
Microsoft 365v=spf1 include:spf.protection.outlook.com -all~2
Google + SendGridv=spf1 include:_spf.google.com include:sendgrid.net -all~4
M365 + Mailchimpv=spf1 include:spf.protection.outlook.com include:servers.mcsv.net -all~4
Google + Amazon SESv=spf1 include:_spf.google.com include:amazonses.com -all~4

SPF records have a limit of 10 DNS lookups. Each include adds at least one lookup, and nested includes add more. Use SPF Record Check to count your total lookups.

Monitor your email authentication

After setting up SPF, make sure it keeps working. Get daily checks on SPF, DKIM, and DMARC.

Start Monitoring

Common Vercel DNS SPF Mistakes

Adding SPF in Vercel When DNS Is at Your Registrar

The most frequent Vercel-specific mistake. If you connected your domain to Vercel via CNAME or A records (without changing nameservers), your DNS is managed at your registrar. Adding TXT records in Vercel's dashboard won't do anything because Vercel isn't serving your DNS. Check your nameservers first, and add SPF records wherever they point.

Creating Duplicate SPF Records

If an SPF record already exists and you add a second one, you'll cause a permerror that breaks SPF entirely. Always check the existing records list before adding a new TXT record starting with v=spf1.

Using @ in the Name Field

Vercel's DNS interface expects a blank Name field for root domain records. Entering @ may not work as expected. Leave it blank to ensure the record is created on your root domain.

Thinking Vercel Handles Email

Vercel is a web hosting platform -- it doesn't send or receive email. Your SPF record is about the email services you use (Google Workspace, Microsoft 365, SendGrid, etc.), not about Vercel itself. You don't need to include Vercel in your SPF record. Vercel just stores and serves the DNS record.

Editing an Existing SPF Record in Vercel

Vercel's DNS interface may require you to delete and recreate records rather than editing them in place. Here's how:

1

Find your SPF record

Go to Domains > your domain and look through the DNS records for the TXT record starting with v=spf1.

2

Remove the old record

Click the delete button (trash icon or X) next to the existing SPF record and confirm the deletion.

3

Add the updated record

Click Add and create a new TXT record with your updated SPF value. Leave the Name blank for root domain. Paste the new SPF value and save.

4

Verify the change

Wait a few minutes, then verify the updated record at SPF Record Check.

Copy first, delete second

Before removing the old SPF record, copy its value somewhere safe. You'll need to reference it when building the updated version, and you'll want a backup just in case.

Vercel DNS vs. Your Registrar: Which Should You Use?

If you're wondering whether to manage DNS through Vercel or your registrar, here's the practical breakdown:

Use Vercel DNS if you want everything in one place and your DNS needs are simple (a few A, CNAME, and TXT records). Vercel DNS works fine for basic setups.

Use your registrar or a dedicated DNS provider if you need DNSSEC, detailed analytics, advanced routing, or more granular TTL control. Cloudflare is a popular free option that pairs well with Vercel hosting.

Either way, your SPF record works the same -- it's just a TXT record. The only thing that matters is adding it where your nameservers point.

Verifying Your SPF Record

After adding or updating your SPF record, verify that it's published correctly.

  • SPF Record Check -- Go to spfrecordcheck.com and enter your domain. It validates syntax, counts DNS lookups, and flags errors.
  • Send a test email -- Send a message from each email service in your SPF record and check the headers for spf=pass.
  • Command line -- Run dig TXT yourdomain.com +short or nslookup -type=TXT yourdomain.com to see the raw TXT records for your domain.

Complete Your Email Authentication

SPF is the first step. For comprehensive email authentication, you need all three protocols:

  • DKIM adds a cryptographic signature to outgoing emails. Use DKIM Creator to generate your DKIM keys and add the TXT records in Vercel DNS (or at your registrar).
  • DMARC ties SPF and DKIM together and defines a policy for when authentication fails. Use DMARC Creator to build your DMARC record.

Both are TXT records, added the same way as SPF -- wherever your DNS is managed.

Never miss an SPF issue

Monitor your SPF, DKIM, DMARC and MX records daily. Get alerts when something breaks.

Start Monitoring