If you’re reading this, you may have been directed here because you were told that your SPF record suffers from a “too many lookups” error.
The specifications for the SPF record limit the number of lookups (such as, translating a name to an IP address) to 10.
How do you know if your SPF record has this issue? Go to this site, enter your domain name, and then click the “Get SPF Record (if any)” button.
An SPF record like what is shown below will have the too many lookup errors.
v=spf1 a mx include:outlook.com include:jangomail.com -all
The output from the testing tool at kitterman.com shows:
Input accepted, querying now…
evaluating v=spf1 a mx include:outlook.com include:jangomail.com -all …
Results – PermError SPF Permanent Error: Too many DNS lookups
Outlook.com by itself eats up 10 lookups, effectively blocking any other entries such as a, mx, and any other includes. The entries in the SPF record that contribute to a lookup include a, mx, ptr, and include.
What counts for a lookup?
The following mechanisms/modifiers count towards the limit: a, mx, ptr, include, redirect, and exists. These items do not count: all, an IP4 address, and an IP6 address. You should avoid using the ptr mechanism. See here for more information on SPF record syntax.
How do you get around the too many lookups error?
1. Use a subdomain to send your email marketing messages. If your acme.com domain would go over the 10 lookups limit by including jangomail.com, then send using something like news.acme.com, “news” being whatever name you want, such as support, info, newsletter, or jm. You won’t be using this subdomain for anything other than sending through an email service provider, which greatly simplifies the SPF record you need.
In your DNS, after you’ve created a new subdomain, create a new TXT record. The “host” value will be the subdomain name (instead of @). The TXT value will be:
v=spf1 a mx include:jangomail.com -all
Note: you’ll also need a domain key for the subdomain. Go through the steps here, the exception being that your domain key will include the subdomain name. If I am using news as my subdomain, then the selector value can be jm (assuming you use jm, or use jangomail, or use whatever you’d like, keeping it to one word). The domain name entry to generate the key in JangoMail/JangoSMTP is your_subdomain_name.com (ex: news.acme.com). View the key and copy the long “k=rsa” string into your clipboard.
When you go into your DNS settings to create the new TXT record, the host value will be jm._domainkey.news. Paste in the string you just copied. You cannot re-use the parent value “k=rsa” string with the subdomain; it has to be its own new/unique value.
Note: if you use a subdomain, don’t forget to include an inbox for the FROM address you’re using. You can have replies to that address forwarded elsewhere (using our branded subdomain setup/feature) so you don’t have to monitor it, or you can just use a REPLY-TO address in your message. Replies normally go to the FROM address. If you have a REPLY-TO address, then that is where replies will go – usually. When someone sends back an out of office reply, that can either go to the FROM or the REPLY-TO address; there is no enforced email standard as to where those should be directed.
2. We can create a custom SPF record for you (contact Support to have this done). This is particularly useful if you are an agency type of user sending on behalf of multiple clients. You can have your clients include your domain name, and then have your domain name point back to either jangomail.com (that does not solve the too many lookups error, or it may cause it in the first place because now there is an extra one, but this is an option for you otherwise as an agency type of sender), or to use a custom SPF record JangoMail creates in our DNS. By using a custom SPF record (e.g., spf27.jangomail.com) that includes your dedicated IP address (or addresses), you minimize the number of changes that have to be made downstream for you clients.
If your IP needs to change (blacklisting, adding a new one, a change in our provider source, etc.), all we have to do is update the IP address on our end. The “name” reference/pointer to the custom SPF record stays in place.
3. If your IP address range falls within one or two of our spf-whatever ranges, just use that instead of jangomail.com. See the list below (and contact Support so we can put a note into your account that you are using spf-a.jangomail.com.
4. Enter what you need via IP address. If you’re using outlook.com in your SPF record, *everything* you enter must be via IP address because of how many lookups outlook.com takes up. If you are using a dedicated IP address with us, you can enter it as ip4:xxx.yyy.zzz.bbb (ex: ip4:126.96.36.199 – this is not an IP address we use; it’s just a numerical example). If you have more than one IP address with us, enter both of them ip4:the_first_address ip4:the_second_address, and so on.
You can use the full translation of “jangomail.com,” but there is no guarantee that the IPs we use will always be the same. The “jangomail.com” domain uses an SPF record of:
v=spf1 include:spf-a.jangomail.com include:spf-b.jangomail.com include:spf-c.jangomail.com include:spf-d.jangomail.com -all
That’s 4 lookups after the initial one for jangomail.com. Individually, they resolve to (last updated 3/11/15):
v=spf1 ip4:188.8.131.52/24 ip4:184.108.40.206/24 ip4:220.127.116.11/24 ip4:18.104.22.168/24 ip4:22.214.171.124/30 ip4:126.96.36.199/24 ip4:188.8.131.52/29 ip4:184.108.40.206/29 -all
v=spf1 ip4:220.127.116.11/24 ip4:18.104.22.168/24 ip4:22.214.171.124/29 ip4:126.96.36.199/24 ip4:188.8.131.52/24 ip4:184.108.40.206/29 ip4:220.127.116.11/29 -all
v=spf1 ip4:18.104.22.168/24 ip4:22.214.171.124/24 ip4:126.96.36.199/29 ip4:188.8.131.52/32 ip4:184.108.40.206/25 ip4:220.127.116.11/24 ip4:18.104.22.168/29 ip4:22.214.171.124/29 -all
v=spf1 ip4:126.96.36.199/24 ip4:188.8.131.52/24 ip4:184.108.40.206/29 ip4:220.127.116.11/24 ip4:18.104.22.168/24 ip4:22.214.171.124/24 ip4:126.96.36.199/27 ip4:188.8.131.52/29 ip4:184.108.40.206/29 -all
Just for grins
What does outlook.com resolve to? Since you asked…
By itself, outlook.com is:
Each subsequent include is shown below.