Need some help in setting up a SPF record

I have setup a SPF record like this: Name - @ Text - “v=spf1 a -all”

But if I do a test using the first SPF Record Testing Tool here:, this is what I get:

" SPF record lookup and validation for:

SPF records are primarily published in DNS as TXT records.

The TXT records found for your domain are: v=spf1a-all

SPF records should also be published in DNS as type SPF records. No type SPF records found.

Checking to see if there is a valid SPF record.

No valid SPF record found of either type TXT or type SPF. "

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi, <br> <br>When setting up SPF records you should either authorize it from a specific IP or domain name. <br> <br>For a specific IP address, from which you will be sending emails, add the following TXT type DNS record: <br> <br>“v=spf1 ip4:IP_ADDRESS -all” <br> <br>Make sure to replace IP_ADDRESS with your droplet’s value from where you will be sending emails. <br> <br>If you would also like to send emails from Google’s mailservers (if you are using Google Apps for example): <br> <br>“v=spf1 -all” <br> <br>So putting it all together, if you are sending emails from your webserver and also using Google Apps mailservers: <br> <br>“v=spf1 ip4:IP_ADDRESS -all” <br> <br>Thanks, <br>Bulat. <br>

I forgot to add the quotes around the SPF. The Kitterman tool showed an invalid SPF with all the spaces removed. As mentioned above, this was due to not having double quotes around the TXT value. <br> <br>I added one set of double quotes surrounding the entire SPF value, as shown above, and hit enter to save the changes in the DO DNS editor. <br> <br>A dig command returned quotes around every string, which is clearly not how it looks in the DO DNS admin, and not how I’d added it. <br> <br>Example <br>“v=spf1” “ip4:” “a” <br> <br>Solution <br>Had to delete the TXT record and re-add it in the correct quoted format for the DNS and then wait about 15 minutes. <br> <br>This may be a bug in the DO DNS editing interface trying to be smart and auto quote TXT values, but going crazy and quoting every string independently.

For Google mail, this official Google help doc suggests using ~all instead of -all: <br> <br>