48

I do not find any guidelines regarding how to configure multiple IPs into an SPF record. So far I used (for example):

v=spf1 ip4:180.72.100.0/24 a mx ?all

But now I should add another range of IPs that are allowed, e.g.

v=spf1 ip4:180.72.100.0/24 ip4:180.20.111.0/24 a mx ?all

Is the second syntax correct? Thanks.

3 Answers 3

33

Yes the second syntax is fine.

Have you tried using the SPF wizard? https://www.spfwizard.net/

It can quickly generate basic and complex SPF records.

7
  • Yes I was using openspf.org but I was just unsure whether I need to comma-separate the entries or newlines... Thanks!
    – basZero
    Commented May 24, 2011 at 16:24
  • Yep it's just newlines in the wizard (no commas) Commented May 25, 2011 at 0:38
  • 5
    Open SPF wizard is not more available. "The retired SPF record wizard For a long time we had a wizard utility to assist domain owners with creating SPF records for their domains. Unfortunately the wizard was not very sophisticated and often ended up generating overly complex or even incorrect records because of the difficulty of correctly explaining the concepts underlying SPF to an audience who simply wanted to create an SPF record quickly and did not care about the finer points. For this reason the wizard has been taken down. Please consult our page on the SPF record syntax instead" Commented Jun 20, 2013 at 18:51
  • @Demelziraptor I got 20 IPs to add. How do I go about doing that? Commented Oct 3, 2014 at 4:50
  • 2
    @netizen0911 if they're within a subnet you can add the range (see in the question, the /24 after the IP denoting the subnet), otherwise you can add them individually; leave the /24 out and just add the IPs separated with spaces ipv4:192.168.0.1 ipv4:192.168.0.2 etc within your SPF record Commented Oct 3, 2014 at 16:17
3

Use CIDR notation such as ip4:180.72.100.0/24 for the range 180.72.100.0 - 180.72.100.255.

And you can have multiple ranges in your SPF record like so:

v=spf1 ip4:180.72.100.0/24 ip4:180.20.111.0/24 a mx ?all

You can use this calculator to determine the correct notation for your IP ranges:

https://account.arin.net/public/cidrCalculator

-1

Try this:

v=spf1 ip4:abc.de.fgh.ij ip4:klm.no.pqr.st ~all
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.