Contact Us

The Skysnag Blog

How to Set Up SPF for Mailgun?

October 12, 2023  |  2 min read

SPF records are used to help prevent email spoofing. They help to ensure that only authorized servers can send emails on behalf of your domain. SPF records can help to improve your email deliverability.

How to Configure SPF for Mailgun

  • Sign in to the management interface of your DNS provider.
  • Go to the page or section designated for modifying the DNS records for your domain. Via DNS Management > Name Server Management > Advanced Settings.
  • Browse your DNS TXT records and check to see if your system already has an SPF record that begins with the mechanism v=spf1.

Please take note that publishing another SPF record after having an existing one will result in SPF failure.

  • If you already have an SPF record, make the necessary changes to add Mailgun.

Add to your existing SPF record

For instance, your modified record will read v=spf1 ~all instead of the prior version’s v=spf1 ~all. Encrypt changes.

  • You must add a new record to your DNS if it does not already contain an SPF record. To add a new DNS TXT SPF record for your domain that uses Mailgun, follow the steps below:
  1. Depending on how you’ve published other TXT records in your DNS, enter @ or leave the field blank for Name/Host/Alias.
  2. You can enter 3600 in the Time to Live (TTL) area or leave it at default.
  3. Fill out the Value field with v=spf1 ~all
  1. Select Add Record and save the SPF TXT record

With Skysnag, you can easily manage Mailgun’s SPF records without having to go to your DNS. This allows Mailgun’s SPF record to propagate instantly, and autonomously always pass SPF alignment.

Sign up for a free trial today to see how it works for your domain

For more information on setting up Mailgun’s SPF, you can refer to their reference documentation.

You can use Skysnag’s free SPF Checker to check the health of your SPF record here

Check your domain’s DMARC security compliance

Enforce DMARC, SPF and DKIM in days - not months

Skysnag helps busy engineers enforce DMARC, responds to any misconfigurations for SPF or DKIM which increases email deliverability, and eliminates email spoofing and identity impersonation.