{"id":16938,"date":"2020-07-28T20:00:01","date_gmt":"2020-07-28T20:00:01","guid":{"rendered":"https:\/\/easydmarc.com\/blog\/?p=16938"},"modified":"2025-07-30T12:43:34","modified_gmt":"2025-07-30T12:43:34","slug":"how-to-optimize-spf-record","status":"publish","type":"post","link":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/","title":{"rendered":"How To Optimize SPF Record?"},"content":{"rendered":"\n<p><span data-preserver-spaces=\"true\">If you have a domain that sends emails, you probably have some default SPF record, already set by the hosting provider. So why do you need to optimize SPF record?<\/span><\/p>\n\n\n\n<p><span data-preserver-spaces=\"true\">That record usually consists of either&nbsp;<\/span><strong><span data-preserver-spaces=\"true\">A<\/span><\/strong><span data-preserver-spaces=\"true\">&nbsp;or&nbsp;<\/span><strong><span data-preserver-spaces=\"true\">IP4 \/ IP6<\/span><\/strong><span data-preserver-spaces=\"true\">&nbsp;and&nbsp;<\/span><strong><span data-preserver-spaces=\"true\">MX&nbsp;<\/span><\/strong><span data-preserver-spaces=\"true\">mechanisms, if you have dedicated hosting, or of&nbsp;<\/span><strong><span data-preserver-spaces=\"true\">MX&nbsp;<\/span><\/strong><span data-preserver-spaces=\"true\">and&nbsp;<\/span><strong><span data-preserver-spaces=\"true\">INCLUDE&nbsp;<\/span><\/strong><span data-preserver-spaces=\"true\">mechanisms, if you use shared hosting.&nbsp;<\/span><\/p>\n\n\n\n<p><span data-preserver-spaces=\"true\">That default SPF record ensures that emails, sent from your website or <a href=\"https:\/\/ultahost.com\/vps-usa\">VPS<\/a> machine, located at your hosting provider, are authenticated.&nbsp;<\/span><\/p>\n\n\n\n<p><span data-preserver-spaces=\"true\">In real life, however, people also use a variety of other 3-rd party systems to send emails from their domain (e.g. CRM, or Cloud email providers such as G Suite or Office 365), so the default record requires modification to cover servers, which 3rd party systems send emails from to keep their emails authenticated.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating-new-or-modifying-existing-SPF-record\">Creating a new or modifying an existing SPF record<\/h2>\n\n\n\n<p><span data-preserver-spaces=\"true\">You can create a new <a href=\"https:\/\/easydmarc.com\/blog\/how-to-set-up-spf-and-dkim-for-bigcommerce\/\">SPF record<\/a> or modify the existing one, using one of the following ways:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>use our <a href=\"https:\/\/easydmarc.com\/tools\/spf-record-generator\/\"> SPF record generator<\/a> form, to create new or update existing SPF record. This tool generates syntax-correct record and at the same time highlights the issues with used mechanisms, if such is detected during generated record validation.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1728\" height=\"1410\" src=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.44.43.png\" alt=\"\" class=\"wp-image-32928\" srcset=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.44.43.png 1728w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.44.43-300x245.png 300w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.44.43-1024x836.png 1024w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.44.43-768x627.png 768w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.44.43-1536x1253.png 1536w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.44.43-1200x979.png 1200w\" sizes=\"(max-width: 1728px) 100vw, 1728px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>use our <a href=\"https:\/\/easydmarc.com\/tools\/spf-record-raw-check-validate\"> SPF record raw validator<\/a> tool if you are well familiar with SPF record syntax and prefer to work with the raw record. This tool validates draft record, shows expanded SPF record tree, and highlights issues if found.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1562\" height=\"1278\" src=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.36.43.png\" alt=\"\" class=\"wp-image-32924\" srcset=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.36.43.png 1562w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.36.43-300x245.png 300w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.36.43-1024x838.png 1024w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.36.43-768x628.png 768w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.36.43-1536x1257.png 1536w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2022-12-27-at-16.36.43-1200x982.png 1200w\" sizes=\"(max-width: 1562px) 100vw, 1562px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"validating-SPF-record-for-correct-syntax-and-limitations\">Validating SPF record for correct syntax and limitations<\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">There are several hidden challenges you may face while maintaining an efficient working SPF record. Some of them relate to record syntax and some to limitations\/restrictions, inherited from times the SPF was established as a standard, back in 2006.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Here is the list of most widely known cases:<\/span><\/p>\n\n\n\n<p><b>1. Using the PTR mechanism<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">PTR mechanism asks to perform DNS reverse-mapping of sending IP address and then perform DNS lookup of returned hostnames to verify if sending IP is among resolved IP addresses. In cases when IP resolves to many hostname records, like e.g.<\/span><a href=\"https:\/\/toolbox.googleapps.com\/apps\/dig\/#PTR\/199.119.121.165\"> <span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">, it will initiate several DNS lookups and may lead to reaching 10 DNS lookups limit, described in one of the following points. It is not possible to validate the PTR mechanism during the SPF record check since it is a dynamic one and depends on sending IP, thus we just show the warning saying that its usage is not recommended.<\/span><\/p>\n\n\n\n<p><b>2. Using CDN to proxy domain DNS<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">If your domain is protected by CDN like e.g. Cloudflare and DNS <\/span><b>A \/ AAAA <\/b><span style=\"font-weight: 400;\">records are proxied, these records will be resolved to proxied IP and not to the actual IP address of the host that sends emails. In such cases, you have to replace <\/span><b>A <\/b><span style=\"font-weight: 400;\">mechanism with <\/span><b>IP4 \/ IP6<\/b><span style=\"font-weight: 400;\"> and specify the actual IP address of sending the server.<\/span><\/p>\n\n\n\n<p><b>3. 10 DNS lookups<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/easydmarc.com\/blog\/spf-too-many-dns-lookups-error\/\">SPF too many DNS lookups<\/a> is the most commonly faced challenge, happening when people add additional email sources to SPF record. As per<\/span><a href=\"https:\/\/tools.ietf.org\/html\/rfc7208#section-4.6.4\"> <span style=\"font-weight: 400;\">RFC7208<\/span><\/a><span style=\"font-weight: 400;\">, to avoid unreasonable load on the DNS the maximum number of allowed DNS lookups should be limited to 10. Each of <\/span><b>a<\/b><span style=\"font-weight: 400;\">, <\/span><b>mx,<\/b><span style=\"font-weight: 400;\"> or <\/span><b>include<\/b><span style=\"font-weight: 400;\"> mechanisms, as well as <\/span><b>redirect<\/b><span style=\"font-weight: 400;\"> modifier, tells the receiving mail server to perform a DNS lookup to resolve the hosts to IP addresses. If SPF record, resolved from <\/span><b>include <\/b><span style=\"font-weight: 400;\">mechanism, contains another <\/span><b>include <\/b><span style=\"font-weight: 400;\">mechanism then DNS lookups count increases by one, and so on. It is not so easy to count the number of lookups and identify the limit&#8217;s exceed without the use of a special <\/span><a href=\"https:\/\/easydmarc.com\/tools\/spf-lookup\"><span style=\"font-weight: 400;\">lookup tool<\/span><\/a>.<span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">SPF record is being read from left to right, thus the mechanism\/modifier, located in string after 10th lookup, will be ignored and emails coming from the source, defined by those ignored mechanisms, will fail SPF authentication with &#8220;permerror&#8221; check result code.<\/span><\/p>\n\n\n\n<p><b>4. Two void lookups<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">This case is mentioned in the same section of RFC7208, defining 10 DNS lookup limitation. If <\/span><b>A, MX, INCLUDE<\/b><span style=\"font-weight: 400;\"> mechanism in SPF record can resolve hostname but returned answer is void (e.g. include:existing-domain-with-no-spf.com), or a cannot resolve hostname (e.g. a:non-exising-domain.com) then it is referred to as &#8220;void lookups&#8221;. The recommendation is to stop processing <a href=\"https:\/\/easydmarc.com\/tools\/spf-lookup\">SPF record lookup<\/a> once void results count has reached 2. Exceeding this limit should produce &#8220;permerror&#8221; check result code as well.<\/span><\/p>\n\n\n\n<p><b>5. Recursive lookups<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">This is also quite hard to detect the case when one include mechanism contains direct or indirect include mechanist to itself, which creates an infinite loop and immediately leads to 10 DNS lookup limitation restriction. Two examples of such records:<\/span><span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">example.com TXT v=spf1 include:example.com ~all<\/span><span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">OR<\/span><span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">sub1.example.com TXT v=spf1 include:sub2example.com include:sub3.example.com ~all<\/span><span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">sub3.example.com TXT v=spf1 include:sub1.example.com ~all<\/span><\/p>\n\n\n\n<p><b>6. White space symbol usage<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">If you accidentally type extra white space symbol in mechanism name or domain name (e.g.&nbsp;<b data-stringify-type=\"bold\">inclu de:_spf.google.com<\/b>&nbsp;or&nbsp;<b data-stringify-type=\"bold\">a:so&nbsp;<\/b><b data-stringify-type=\"bold\">mecrm.com<\/b><b data-stringify-type=\"bold\">&nbsp;<\/b>or&nbsp;<b data-stringify-type=\"bold\">ip 4:12.3 4.56.78&nbsp;<\/b>)<span class=\"c-message__edited_label\" dir=\"ltr\" data-sk=\"tooltip_parent\">&nbsp;<\/span><\/span><span style=\"font-weight: 400;\">&nbsp;the rest of string, after unrecognized element, may be ignored so the correct sources, listed after bad element, will drop when receiving mail server performs a lookup of your domain SPF record. Also, the white space in the hostname, <\/span><b>A<\/b><span style=\"font-weight: 400;\">&nbsp;and <\/span><b>INCLUDE <\/b><span style=\"font-weight: 400;\">mechanisms point to, is treated as a void lookup.<\/span><\/p>\n\n\n\n<p><b>7. More than one SPF records<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">You need to be sure that only one TXT record, starting with &#8220;<\/span><b>v=spf1<\/b><span style=\"font-weight: 400;\">&#8220;, exists in domain DNS. Having more than one TXT record, starting with &#8220;<\/span><b>v=spf1<\/b><span style=\"font-weight: 400;\">&#8221; will cause unpredicted results of lookup by receiving mail server and SPF validation may fail.<\/span><\/p>\n\n\n\n<p><b>8. SPF record length<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Single TXT record data string&#8217;s maximum length is limited to 255 bytes, though, according to<\/span><a href=\"https:\/\/tools.ietf.org\/html\/rfc7208#section-3.3\"> <span style=\"font-weight: 400;\">RFC7208<\/span><\/a><span style=\"font-weight: 400;\">, multiple data strings, each with up to 255 bytes long, can be concatenated into one TXT record, if you need a longer SPF record. E.g.<\/span><b><i>TXT &#8220;v=spf1 &#8230;. first string-&#8221; &#8220;second string&#8230;&#8221; <\/i><\/b><span style=\"font-weight: 400;\">will be parsed as <\/span><b><i>TXT &#8220;v=spf1 &#8230;. first string-second string&#8230;&#8221;<\/i><\/b><b><i><br \/><\/i><\/b><b><i><br \/><\/i><\/b><span style=\"font-weight: 400;\">You will also need to ensure that your domain host provider&#8217;s DNS zone management interface supports TXT records longer than 255 bytes. If it is not the case you have to consider moving your domain DNS zone to some alternative system, which supports long TXT records, e.g. Cloudflare.Besides the above said there is another important limitation specific to SPF type of TXT records. It is recommended to keep record size small enough, so the result of the DNS query response will fit with 512 bytes. Otherwise, there is a possibility of exceeding a UDP packet size limit, defined in<\/span><a href=\"https:\/\/tools.ietf.org\/html\/rfc1035#section-2.3.4\"> <span style=\"font-weight: 400;\">DNS protocol<\/span><\/a><span style=\"font-weight: 400;\">.&nbsp; Though this limitation was revised in<\/span><a href=\"https:\/\/tools.ietf.org\/html\/rfc6891#section-6.2.3\"> <span style=\"font-weight: 400;\">RFC6891<\/span><\/a><span style=\"font-weight: 400;\">, staying below 512 bytes still should eliminate cases receiving parties with older, RFC6891 non-ready DNS implementation, fail to validate emails from domain having long SPF record.In fact, the DNS query, executed to read SPF record, returns not only the SPF record but all TXT records, published in domain DNS. Since your domain may (and probably does) have other TXT records, like Google sites, Microsoft O365 or other systems verification TXT records, you have to remember to count them as well when calculating the size left for SPF record (512 &#8211; DNS hostname &#8211; all other TXT records length).You can use <\/span><b><i>dig example.com<\/i><\/b><span style=\"font-weight: 400;\"> txt command in Linux or<\/span><a href=\"https:\/\/www.digwebinterface.com\"> <span style=\"font-weight: 400;\">Dig Web Interface<\/span><\/a><span style=\"font-weight: 400;\"> online tool to see how many TXT records you have and calculate the safe size for the SPF record.See the example of a domain with many TXT records:<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"512\" height=\"157\" src=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/unnamed.png\" alt=\"domain-with-several-TXT-records\" class=\"wp-image-16942\" srcset=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/unnamed.png 512w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/unnamed-300x92.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/figure>\n<\/div>\n\n\n<p><span style=\"font-weight: 400;\">All above cases can be detected and displayed by our <\/span><a href=\"https:\/\/easydmarc.com\/tools\/spf-lookup\"><span style=\"font-weight: 400;\">SPF Record Lookup<\/span><\/a><span style=\"font-weight: 400;\"> tool, see the screenshot:<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"349\" src=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/SPF-Lookup-Tree.png\" alt=\"Detect-SPF-issues-with-SPF-record-lookup\" class=\"wp-image-16943\" srcset=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/SPF-Lookup-Tree.png 512w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/SPF-Lookup-Tree-300x204.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"optimizing-SPF-record\">Optimizing SPF record<\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Below you can find the steps that would help you to optimize SPF record:<\/span><\/p>\n\n\n\n<p><b>1. Change sources order<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">SPF record is being read from left to right, so it makes sense to put the most critical or frequently used email sources at the beginning of the record.<\/span><\/p>\n\n\n\n<p><b>2. Clean up the record from duplicate sources<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Sometimes you may need to free up costly SPF space from duplicate sources, add new ones, particularly when you are about to reach 10 DNS lookups limit. Use our<\/span><a href=\"https:\/\/easydmarc.com\/tools\/spf-lookup\"> <span style=\"font-weight: 400;\">SPF Record Lookup<\/span><\/a><span style=\"font-weight: 400;\"> tool to detect duplicate sources in the SPF record&#8217;s expanded tree.<\/span><\/p>\n\n\n\n<p><b>3. Get rid of legacy \/ obsolete sources<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">If you are analyzing <a href=\"https:\/\/easydmarc.com\/blog\/understanding-dmarc-reports\/\">DMARC reports<\/a> for a sufficient period of time (say during 1-2 months) you would be able to see some sources, added to the SPF record, which was not sending emails during that period.&nbsp; Ensure whether the associated systems still are used in your company, and remove them if they are no longer used.<\/span><\/p>\n\n\n\n<p><b>4. Reduce the number of INCLUDEs<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Each INCLUDE mechanism takes one DNS lookup. If the INCLUDE mechanism does not contain directly added IP4\/IP6 mechanisms but contains other INCLUDEs, which also take per one DNS lookup, you can try to replace those INCLUDEs with IP4\/IP6.<\/span><span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">However, it is a very tricky step, especially when INCLUDE refers to 3rd party ESP service. You may easily break your emails SPF compliance because you will never know if one day your ESP decides to send emails from new IPs and update their SPF. Also, you need to remember about the recommended limiting of SPF record size to fit in DNS query UDP response packet (512 bytes).<\/span><\/p>\n\n\n\n<p><b>5. Avoid using MX and A mechanisms<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">MX mechanism takes one DNS lookup from 10 DNS lookups limit, and it also triggers a DNS lookup for hostnames your MX records points to. While these lookups do not count against the SPF record DNS lookups limit, they however may increase the latency of emails delivery time.<\/span><span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">It would be more reasonable to use IP4 \/ IP6 mechanisms instead and include IP ranges your MX sends mails from, to save on DNS query response times.<\/span><span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">Using IP4\/IP6 directives instead is suitable for A mechanism too.<\/span><\/p>\n\n\n\n<p><b>6. Remove sender-domain-unaligned sources<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">As you know <a href=\"https:\/\/easydmarc.com\/tools\/spf-lookup\">SPF check<\/a> runs against the domain in Return-path (smtp.mailfrom) email address or domain in smtp.helo (when smtp.mailfrom is empty). Usually, the domain in &#8220;Header From&#8221; and &#8220;Return-path&#8221; addresses are the same. In Gmail, you can see &#8220;Header From&#8221; address in the <\/span><b>from <\/b><span style=\"font-weight: 400;\">field and &#8220;Return-path \/ smtp.helo&#8221; domain in <\/span><b>mailed-by.<br \/><\/b><span style=\"font-weight: 400;\">See the example below:<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"403\" height=\"216\" src=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/image-1.png\" alt=\"Gmail-Header-From-and-Return-path-address\" class=\"wp-image-16944\" srcset=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/image-1.png 403w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/image-1-300x161.png 300w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/figure>\n<\/div>\n\n\n<p><i><span style=\"font-weight: 400;\">Header From: VMware &lt;vmwareteam@engage.vmware.com&gt;<br \/><\/span><\/i><i><span style=\"font-weight: 400;\">Return-Path: &lt;bounce@engage.vmware.com&gt;<\/span><\/i><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Some ESPs, however, use their own domain in Return-path email address, see example below:<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"267\" src=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/ESP-return-path.png\" alt=\"ESP-Return-path-address\" class=\"wp-image-16945\" srcset=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/ESP-return-path.png 525w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/ESP-return-path-300x153.png 300w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/figure>\n<\/div>\n\n\n<p><br \/><i><span style=\"font-weight: 400;\">Header From: Booked Scheduler &lt;support@bookedscheduler.com&gt;<br \/><\/span><\/i><i><span style=\"font-weight: 400;\">Return-Path: &lt;bounce-mc.us19_134631002.4790858-956d20b353@mail249.suw12.mcsv.net&gt;<br \/><\/span><\/i><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Configuration guides of many of those &#8220;non-compliant&#8221; ESPs either recommend or demand you to add their SPF include string in your domain SPF record. Obviously this is a result of poor knowledge of how SPF verification works. The incomplete list of well-known ESPs that use their own domain in Return-path addresses is: Active Campaign, Aweber, Mailchimp, Marketo, Salesforce.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Since, as we mentioned earlier, the receiving server performs a check of SPF record of the domain, mentioned in Return-path address, and not in Header From address, there is no requirement to add ESP&#8217;s SPF include string to your domain SPF record, to occupy costly space and trigger useless DNS lookups.<\/span><\/p>\n\n\n\n<p><b>7. Move part of sources to the subdomain<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">When, due to usage of many INCLUDE mechanisms, 10 DNS lookups limit is fully exhausted, you may try reconfigure some email sources to send from a subdomain and not root domain (see the VMware email sample in point 6) and move those sources INCLUDE string to new SPF record, created for the subdomain.<\/span><\/p>\n\n\n\n<p><b>8. Use our<\/b> <a href=\"https:\/\/easydmarc.com\/easy-spf-too-many-dns-lookups\"><b>EasySPF<\/b><\/a><b> for smart and dynamic flattening of SPF record<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">And finally, if you do not like to implement above 7 recommendations yourself, which will definitely take a lot of your time for optimization as well as assume regular checking of 3rd party ESPs&#8217; SPF record for possible changes (applicable if you implement recommendation #4 you can use our<\/span><a href=\"https:\/\/easydmarc.com\/easy-spf-too-many-dns-lookups\"> <span style=\"font-weight: 400;\">EasySPF<\/span><\/a><span style=\"font-weight: 400;\"> solution which does all above recommendations for you automatically, without any intervention from your side.<\/span><span style=\"font-weight: 400;\"><br \/><\/span><span style=\"font-weight: 400;\">You will just need to activate the EasySPF service and replace your SPF record with our, customized one for smart SPF.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"319\" src=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/EasySPF.png\" alt=\"EasySPF-feature \" class=\"wp-image-16946\" srcset=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/EasySPF.png 512w, https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/EasySPF-300x187.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>If you have a domain that sends emails, &#8230;<\/p>\n","protected":false},"author":1,"featured_media":32205,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[204,203,286],"tags":[],"class_list":["post-16938","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-email-security","category-spf"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How To Optimize SPF Record? v spf1 a mx<\/title>\n<meta name=\"description\" content=\"How to optimize SPF record for the most widely known issues with DNS SPF record: 10 DNS lookups, SPF record symbol limitations. v spf1 a mx\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Optimize SPF Record?\" \/>\n<meta property=\"og:description\" content=\"How to optimize SPF record for the most widely known issues with DNS SPF record: 10 DNS lookups, SPF record symbol limitations. v spf1 a mx\" \/>\n<meta property=\"og:url\" content=\"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/\" \/>\n<meta property=\"og:site_name\" content=\"EasyDMARC\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/EasyDMARC\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-28T20:00:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-30T12:43:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/How-To-Optimize-SPF-Record_-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1440\" \/>\n\t<meta property=\"og:image:height\" content=\"910\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"EasyDMARC\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@easydmarc\" \/>\n<meta name=\"twitter:site\" content=\"@easydmarc\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"EasyDMARC\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/\"},\"author\":{\"name\":\"EasyDMARC\",\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/#\\\/schema\\\/person\\\/449261e9810b270cc697c7c9c5b89e97\"},\"headline\":\"How To Optimize SPF Record?\",\"datePublished\":\"2020-07-28T20:00:01+00:00\",\"dateModified\":\"2025-07-30T12:43:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/\"},\"wordCount\":2015,\"publisher\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/How-To-Optimize-SPF-Record_-1.jpg\",\"articleSection\":[\"Blog\",\"Email Security\",\"SPF\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/\",\"url\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/\",\"name\":\"How To Optimize SPF Record? v spf1 a mx\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/How-To-Optimize-SPF-Record_-1.jpg\",\"datePublished\":\"2020-07-28T20:00:01+00:00\",\"dateModified\":\"2025-07-30T12:43:34+00:00\",\"description\":\"How to optimize SPF record for the most widely known issues with DNS SPF record: 10 DNS lookups, SPF record symbol limitations. v spf1 a mx\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/#primaryimage\",\"url\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/How-To-Optimize-SPF-Record_-1.jpg\",\"contentUrl\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/How-To-Optimize-SPF-Record_-1.jpg\",\"width\":1440,\"height\":910,\"caption\":\"How To Optimize SPF Record 1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/how-to-optimize-spf-record\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/easydmarc.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/category\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Email Security\",\"item\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/category\\\/blog\\\/email-security\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"SPF\",\"item\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/category\\\/blog\\\/email-security\\\/spf\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How To Optimize SPF Record?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/\",\"name\":\"EasyDMARC\",\"description\":\"Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/easydmarc.com\\\/#organization\",\"name\":\"EasyDMARC\",\"url\":\"https:\\\/\\\/easydmarc.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/easydmarc.com\\\/img\\\/logo.png\"},\"image\":{\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/EasyDMARC\\\/\",\"https:\\\/\\\/x.com\\\/easydmarc\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/easydmarc\\\/mycompany\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/#\\\/schema\\\/person\\\/449261e9810b270cc697c7c9c5b89e97\",\"name\":\"EasyDMARC\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fcbf1ca829f8e0977fce524da20caa8a528368d0909ce48741526046e5113259?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fcbf1ca829f8e0977fce524da20caa8a528368d0909ce48741526046e5113259?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fcbf1ca829f8e0977fce524da20caa8a528368d0909ce48741526046e5113259?s=96&r=g\",\"caption\":\"EasyDMARC\"},\"url\":\"https:\\\/\\\/easydmarc.com\\\/blog\\\/author\\\/easydmarc\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To Optimize SPF Record? v spf1 a mx","description":"How to optimize SPF record for the most widely known issues with DNS SPF record: 10 DNS lookups, SPF record symbol limitations. v spf1 a mx","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/","og_locale":"en_US","og_type":"article","og_title":"How To Optimize SPF Record?","og_description":"How to optimize SPF record for the most widely known issues with DNS SPF record: 10 DNS lookups, SPF record symbol limitations. v spf1 a mx","og_url":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/","og_site_name":"EasyDMARC","article_publisher":"https:\/\/www.facebook.com\/EasyDMARC\/","article_published_time":"2020-07-28T20:00:01+00:00","article_modified_time":"2025-07-30T12:43:34+00:00","og_image":[{"width":1440,"height":910,"url":"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/How-To-Optimize-SPF-Record_-1.jpg","type":"image\/jpeg"}],"author":"EasyDMARC","twitter_card":"summary_large_image","twitter_creator":"@easydmarc","twitter_site":"@easydmarc","twitter_misc":{"Written by":"EasyDMARC","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/#article","isPartOf":{"@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/"},"author":{"name":"EasyDMARC","@id":"https:\/\/easydmarc.com\/blog\/#\/schema\/person\/449261e9810b270cc697c7c9c5b89e97"},"headline":"How To Optimize SPF Record?","datePublished":"2020-07-28T20:00:01+00:00","dateModified":"2025-07-30T12:43:34+00:00","mainEntityOfPage":{"@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/"},"wordCount":2015,"publisher":{"@id":"https:\/\/easydmarc.com\/blog\/#organization"},"image":{"@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/#primaryimage"},"thumbnailUrl":"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/How-To-Optimize-SPF-Record_-1.jpg","articleSection":["Blog","Email Security","SPF"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/","url":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/","name":"How To Optimize SPF Record? v spf1 a mx","isPartOf":{"@id":"https:\/\/easydmarc.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/#primaryimage"},"image":{"@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/#primaryimage"},"thumbnailUrl":"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/How-To-Optimize-SPF-Record_-1.jpg","datePublished":"2020-07-28T20:00:01+00:00","dateModified":"2025-07-30T12:43:34+00:00","description":"How to optimize SPF record for the most widely known issues with DNS SPF record: 10 DNS lookups, SPF record symbol limitations. v spf1 a mx","breadcrumb":{"@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/#primaryimage","url":"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/How-To-Optimize-SPF-Record_-1.jpg","contentUrl":"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/How-To-Optimize-SPF-Record_-1.jpg","width":1440,"height":910,"caption":"How To Optimize SPF Record 1"},{"@type":"BreadcrumbList","@id":"https:\/\/easydmarc.com\/blog\/how-to-optimize-spf-record\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/easydmarc.com\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/easydmarc.com\/blog\/category\/blog\/"},{"@type":"ListItem","position":3,"name":"Email Security","item":"https:\/\/easydmarc.com\/blog\/category\/blog\/email-security\/"},{"@type":"ListItem","position":4,"name":"SPF","item":"https:\/\/easydmarc.com\/blog\/category\/blog\/email-security\/spf\/"},{"@type":"ListItem","position":5,"name":"How To Optimize SPF Record?"}]},{"@type":"WebSite","@id":"https:\/\/easydmarc.com\/blog\/#website","url":"https:\/\/easydmarc.com\/blog\/","name":"EasyDMARC","description":"Blog","publisher":{"@id":"https:\/\/easydmarc.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/easydmarc.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/easydmarc.com\/#organization","name":"EasyDMARC","url":"https:\/\/easydmarc.com\/","logo":{"@type":"ImageObject","url":"https:\/\/easydmarc.com\/img\/logo.png"},"image":{"@id":"https:\/\/easydmarc.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/EasyDMARC\/","https:\/\/x.com\/easydmarc","https:\/\/www.linkedin.com\/company\/easydmarc\/mycompany\/"]},{"@type":"Person","@id":"https:\/\/easydmarc.com\/blog\/#\/schema\/person\/449261e9810b270cc697c7c9c5b89e97","name":"EasyDMARC","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/fcbf1ca829f8e0977fce524da20caa8a528368d0909ce48741526046e5113259?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/fcbf1ca829f8e0977fce524da20caa8a528368d0909ce48741526046e5113259?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fcbf1ca829f8e0977fce524da20caa8a528368d0909ce48741526046e5113259?s=96&r=g","caption":"EasyDMARC"},"url":"https:\/\/easydmarc.com\/blog\/author\/easydmarc\/"}]}},"jetpack_featured_media_url":"https:\/\/easydmarc.com\/blog\/wp-content\/uploads\/2020\/07\/How-To-Optimize-SPF-Record_-1.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/posts\/16938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/comments?post=16938"}],"version-history":[{"count":2,"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/posts\/16938\/revisions"}],"predecessor-version":[{"id":50079,"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/posts\/16938\/revisions\/50079"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/media\/32205"}],"wp:attachment":[{"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/media?parent=16938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/categories?post=16938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easydmarc.com\/blog\/wp-json\/wp\/v2\/tags?post=16938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}