Add two IP Addresses to an SPF Record?


I have two websites, on two different Droplets (with different IP addresses)

Both websites use the same domain, the first website is and second website is

I need to edit my SPF record so it can allow both IP Addresses to to use the domain

When I use the correct IP Address the SPF record below works (for one of the websites).

v=spf1 ip4:167.XX.XXX.40 -all

Let’s say one droplet IP address is: 167.XX.XXX.40 and the other IP address is 167.XX.XXX.247

How would I add both to the same SPF record?

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.

Accepted Answer

record - @ – v=spf1 +a +mx ip4:167.XX.XXX.247 ip4:167.XX.XXX.40 ~all

v=spf1 a -all From everything I read, that should allow every IP listed in your A records to send mail. But, so far it’s not working for me.

Recipient address rejected: Message rejected due to: SPF fail - not authorized

(a) or (+a) seem to be the same thing, (a) just defaults to (+a)

You can enter the IP manually like shown in other answers, but it seems like (a) should have worked if both your servers have A records. Perhaps mine isn’t working because it needs to propagate. :(

Hi Jason,

Thanks for the reply.

After a bit of searching I found this , it looks like this would also work:

v=spf1 ip4:167.XX.XXX.247 ip4:167.XX.XXX.40 ~all

The a and the mx mechanisms default to +, so I guess there’s no need to specify them as such.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel