[{"data":1,"prerenderedAt":345},["ShallowReactive",2],{"tool-spf-lookup":3},{"id":4,"title":5,"body":6,"description":319,"extension":320,"faq":321,"h1":337,"intro":338,"meta":339,"navigation":340,"path":341,"seo":342,"stem":343,"__hash__":344},"tools\u002Ftools\u002Fspf-lookup.md","SPF Checker: SPF Record Lookup and Validator",{"type":7,"value":8,"toc":313},"minimark",[9,14,40,56,63,67,134,138,147,156,172,178,194,201,224,238,255,265,274,281,295,299,309],[10,11,13],"h2",{"id":12},"what-an-spf-record-is","What an SPF record is",[15,16,17,18,25,26,30,31,35,36,39],"p",{},"SPF (Sender Policy Framework, ",[19,20,24],"a",{"href":21,"rel":22},"https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc7208",[23],"nofollow","RFC 7208",") is a TXT record at the root of a domain that lists the servers allowed to send mail using that domain in the ",[27,28,29],"strong",{},"envelope sender",", the address in ",[32,33,34],"code",{},"MAIL FROM",", which ends up in the ",[32,37,38],{},"Return-Path"," header. A receiving server looks it up, works through the mechanisms left to right, and stops at the first one that matches the connecting IP.",[41,42,47],"pre",{"className":43,"code":44,"language":45,"meta":46,"style":46},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","example.com.  TXT  \"v=spf1 ip4:192.0.2.0\u002F24 include:_spf.google.com ~all\"\n","txt","",[32,48,49],{"__ignoreMap":46},[50,51,54],"span",{"class":52,"line":53},"line",1,[50,55,44],{},[15,57,58,59,62],{},"That record says: the ",[32,60,61],{},"192.0.2.0\u002F24"," range may send, so may anything Google's SPF record allows, and everything else soft fails.",[10,64,66],{"id":65},"how-to-read-the-result","How to read the result",[68,69,70,93,103,120],"ul",{},[71,72,73,76,77,80,81,84,85,88,89,92],"li",{},[27,74,75],{},"Mechanisms",": each term in order, its qualifier, and what it matches. ",[32,78,79],{},"+"," (the default) is Pass, ",[32,82,83],{},"-"," is Fail, ",[32,86,87],{},"~"," is SoftFail and ",[32,90,91],{},"?"," is Neutral.",[71,94,95,98,99,102],{},[27,96,97],{},"DNS lookups",": the total across the whole include tree. This is the number receivers count, not the number of terms you can see in your own record. ",[32,100,101],{},"include:_spf.google.com"," costs one; an include that contains three more includes costs four.",[71,104,105,108,109,111,112,115,116,119],{},[27,106,107],{},"Void lookups",": DNS queries that return no records or NXDOMAIN. RFC 7208 lets receivers fail the check after two. They usually come from an ",[32,110,19],{},", ",[32,113,114],{},"mx"," or ",[32,117,118],{},"include"," pointing at a name that no longer exists.",[71,121,122,125,126,129,130,133],{},[27,123,124],{},"Includes",": each ",[32,127,128],{},"include:"," and ",[32,131,132],{},"redirect="," row shows the record it pulls in, the includes nested inside it, and how many lookups it costs.",[10,135,137],{"id":136},"common-failures-and-how-to-fix-them","Common failures and how to fix them",[15,139,140,143,144,146],{},[27,141,142],{},"Too many DNS lookups."," The usual cause is adding one ",[32,145,128],{}," per tool over the years.",[41,148,150],{"className":43,"code":149,"language":45,"meta":46,"style":46},"v=spf1 include:_spf.google.com include:spf.protection.outlook.com include:sendgrid.net include:mailgun.org include:servers.mcsv.net include:_spf.salesforce.com include:mail.zendesk.com a mx ~all\n",[32,151,152],{"__ignoreMap":46},[50,153,154],{"class":52,"line":53},[50,155,149],{},[15,157,158,159,129,161,163,164,167,168,171],{},"Remove includes for services you no longer use. Replace ",[32,160,19],{},[32,162,114],{}," with the ",[32,165,166],{},"ip4:"," ranges they resolve to, if those addresses are stable. Move bulk or marketing mail to a subdomain such as ",[32,169,170],{},"mail.example.com"," with its own SPF record. \"SPF flattening\" services replace includes with IP lists; they work, but the lists go stale whenever a provider changes its ranges, so prefer the other options first.",[15,173,174,177],{},[27,175,176],{},"Two SPF records."," This often happens when a new provider's setup guide says \"add this TXT record\" and the old one stays:",[41,179,181],{"className":43,"code":180,"language":45,"meta":46,"style":46},"example.com.  TXT  \"v=spf1 include:_spf.google.com ~all\"\nexample.com.  TXT  \"v=spf1 include:sendgrid.net ~all\"\n",[32,182,183,188],{"__ignoreMap":46},[50,184,185],{"class":52,"line":53},[50,186,187],{},"example.com.  TXT  \"v=spf1 include:_spf.google.com ~all\"\n",[50,189,191],{"class":52,"line":190},2,[50,192,193],{},"example.com.  TXT  \"v=spf1 include:sendgrid.net ~all\"\n",[15,195,196,197,200],{},"Merge them into one: ",[32,198,199],{},"v=spf1 include:_spf.google.com include:sendgrid.net ~all",".",[15,202,203,211,212,214,215,217,218,115,221,200],{},[27,204,205,115,208,200],{},[32,206,207],{},"+all",[32,209,210],{},"?all"," ",[32,213,207],{}," passes every server on the internet. ",[32,216,210],{}," is the same as having no policy. End the record with ",[32,219,220],{},"~all",[32,222,223],{},"-all",[15,225,226,211,234,237],{},[27,227,228,231,232,200],{},[32,229,230],{},"include="," instead of ",[32,233,128],{},[32,235,236],{},"include=_spf.google.com"," is parsed as an unknown modifier and silently ignored, so Google's servers are not authorized. The checker flags this.",[15,239,240,245,246,248,249,252,253,200],{},[27,241,242,200],{},[32,243,244],{},"ptr"," Deprecated by RFC 7208: it is slow, depends on reverse DNS you often do not control, and some receivers skip it. Replace it with ",[32,247,166],{},"\u002F",[32,250,251],{},"ip6:"," or an ",[32,254,128],{},[15,256,257,260,261,264],{},[27,258,259],{},"Long records split badly."," A single TXT string holds at most 255 characters, so longer records are published as several strings. Receivers join them ",[27,262,263],{},"without"," adding a space. A split in the middle of a term is fine as long as the joined text is correct:",[41,266,268],{"className":43,"code":267,"language":45,"meta":46,"style":46},"\"v=spf1 ... ip4:62.253.2\" \"27.114 ip4:166.78.69.169 ~all\"\n",[32,269,270],{"__ignoreMap":46},[50,271,272],{"class":52,"line":53},[50,273,267],{},[15,275,276,277,280],{},"joins to ",[32,278,279],{},"ip4:62.253.227.114",". A split that drops or adds a character breaks the term. The checker shows the string lengths so you can see where the boundary falls.",[15,282,283,286,287,290,291,294],{},[27,284,285],{},"SPF passes but mail still fails DMARC."," SPF only checks the envelope sender. If your email service sends with ",[32,288,289],{},"Return-Path: bounces@esp-mail.net",", SPF passes for ",[32,292,293],{},"esp-mail.net",", not for you. Set up the provider's custom return-path (or bounce) domain so it aligns with your From domain, or rely on DKIM alignment.",[10,296,298],{"id":297},"checking-it-end-to-end","Checking it end to end",[15,300,301,302,129,305,308],{},"DNS shows what you published, not what a receiver concluded. To see the verdict, send a message and read the ",[32,303,304],{},"Authentication-Results",[32,306,307],{},"Received-SPF"," headers on the receiving side. That shows which IP was checked, against which envelope domain, and the result.",[310,311,312],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":46,"searchDepth":190,"depth":190,"links":314},[315,316,317,318],{"id":12,"depth":190,"text":13},{"id":65,"depth":190,"text":66},{"id":136,"depth":190,"text":137},{"id":297,"depth":190,"text":298},"Check an SPF record for any domain. Follows every include, counts DNS lookups against the limit of 10, and flags syntax errors, +all, ptr and void lookups.","md",[322,325,328,331,334],{"question":323,"answer":324},"What does the 10 DNS lookup limit count?","Every include, a, mx, ptr and exists mechanism, and the redirect modifier, costs one lookup, including the ones inside records you include. ip4, ip6 and all are free. When the total passes 10, receivers stop evaluating and return permerror, so SPF fails for every message.",{"question":326,"answer":327},"Should I use ~all or -all?","If you publish DMARC at quarantine or reject, ~all is enough, because DMARC decides what happens to failing mail. -all makes a few receivers reject on SPF alone, before DKIM or DMARC are considered, which can drop forwarded mail. Never use +all, which authorizes every server on the internet.",{"question":329,"answer":330},"Can a domain have two SPF records?","No. With more than one TXT record starting with v=spf1, receivers return permerror and SPF fails. Merge them into one record that lists every sender.",{"question":332,"answer":333},"Why does my SPF pass but DMARC fail?","SPF checks the envelope sender (Return-Path), not the From header. DMARC also needs that envelope domain to align with the From domain. Many email services use their own Return-Path domain unless you set up a custom bounce or return-path domain.",{"question":335,"answer":336},"Does the SPF lookup cache results?","Answers are cached for up to five minutes, or less if the record TTL is shorter. If you just changed a record, your DNS provider may also take a while to serve the new one.","SPF record checker","Enter a domain to look up its SPF record. The checker parses each mechanism, follows include: and redirect= all the way down, and counts DNS lookups against the limit of 10 that receivers enforce.",{},true,"\u002Ftools\u002Fspf-lookup",{"title":5,"description":319},"tools\u002Fspf-lookup","MrmKzFFLVDM7vwC0YhzesEzTWJbzPeGouHTxmWdEv-g",1795555759366]