<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mogley1011</title>
    <description>The latest articles on DEV Community by Mogley1011 (@mogley1011).</description>
    <link>https://dev.to/mogley1011</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4155865%2F85c24e37-5231-4973-99e1-32719c6824de.png</url>
      <title>DEV Community: Mogley1011</title>
      <link>https://dev.to/mogley1011</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mogley1011"/>
    <language>en</language>
    <item>
      <title>SPF "too many DNS lookups" (permerror): why it happens and how to fix it</title>
      <dc:creator>Mogley1011</dc:creator>
      <pubDate>Thu, 22 Oct 2026 07:10:03 +0000</pubDate>
      <link>https://dev.to/mogley1011/spf-too-many-dns-lookups-permerror-why-it-happens-and-how-to-fix-it-cke</link>
      <guid>https://dev.to/mogley1011/spf-too-many-dns-lookups-permerror-why-it-happens-and-how-to-fix-it-cke</guid>
      <description>&lt;p&gt;If a DMARC report or a checker says &lt;code&gt;spf=permerror&lt;/code&gt; or "SPF exceeded 10 DNS lookups", your SPF record is being ignored by receivers, even though it looks fine when you read it. Here is what is actually counted and how to get back under the limit.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the limit is
&lt;/h2&gt;

&lt;p&gt;RFC 7208 allows at most &lt;strong&gt;10 DNS-querying terms&lt;/strong&gt; while evaluating one SPF record. These count: &lt;code&gt;include&lt;/code&gt;, &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;mx&lt;/code&gt;, &lt;code&gt;ptr&lt;/code&gt;, &lt;code&gt;exists&lt;/code&gt; and &lt;code&gt;redirect&lt;/code&gt;. These do not: &lt;code&gt;ip4&lt;/code&gt;, &lt;code&gt;ip6&lt;/code&gt; and &lt;code&gt;all&lt;/code&gt;. The count is recursive, so each &lt;code&gt;include:&lt;/code&gt; also adds whatever lookups sit inside the record it points to.&lt;/p&gt;

&lt;p&gt;That is how a short record blows the budget. &lt;code&gt;include:_spf.google.com&lt;/code&gt; is one lookup that expands to several more. Add a marketing platform, a helpdesk, a CRM, and Microsoft 365, and you are over 10 without trying.&lt;/p&gt;

&lt;p&gt;There is a second, quieter limit: more than &lt;strong&gt;2 "void" lookups&lt;/strong&gt; (names that return nothing) also produces a permerror.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Count it properly
&lt;/h2&gt;

&lt;p&gt;Do not count the &lt;code&gt;include:&lt;/code&gt; entries by eye. Resolve each one and count the terms inside it. Write the tree out on paper: top-level record, then each include, then each include inside those.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Remove what you no longer use
&lt;/h2&gt;

&lt;p&gt;In almost every audit the fastest win is dead weight: the tool you cancelled in 2022, the old hosting provider, a duplicate include. Each one removed frees one or more lookups. Check against your real senders, not against what the record says.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Replace lookups with fixed addresses where the provider's IPs are stable
&lt;/h2&gt;

&lt;p&gt;An &lt;code&gt;a:&lt;/code&gt; or &lt;code&gt;mx:&lt;/code&gt; term costs a lookup. If your own server's IP never changes, &lt;code&gt;ip4:203.0.113.5&lt;/code&gt; costs none. Only do this for addresses you control. Never hard-code a big provider's ranges, because they change and you will silently break your own mail.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Split by sending subdomain
&lt;/h2&gt;

&lt;p&gt;Give each sender its own subdomain (for example &lt;code&gt;news.example.com&lt;/code&gt; for the newsletter platform) with its own SPF record and its own 10-lookup budget. Your main domain's record then stays small, and a problem with one tool cannot take down the others. DKIM and DMARC alignment need to be set up for each subdomain, so plan that at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Flattening, with care
&lt;/h2&gt;

&lt;p&gt;Flattening replaces includes with the IPs they resolve to. It fixes the count, but provider ranges change, so a static flattened record goes stale and starts rejecting real mail. If you flatten, it has to be kept up to date automatically, and you need a way to notice when it drifts.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Verify
&lt;/h2&gt;

&lt;p&gt;After the change, re-resolve the whole tree and confirm you are at 10 or under, with no more than 2 void lookups. Then send a test to a Gmail and an Outlook address and check &lt;code&gt;Authentication-Results&lt;/code&gt; for &lt;code&gt;spf=pass&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part most people skip
&lt;/h2&gt;

&lt;p&gt;The record is only correct today. Every new SaaS tool someone adds to the stack can quietly push you back over the limit, and you find out when mail starts failing. I now treat the lookup count as something to watch continuously, the same way you would watch certificate expiry, rather than something to fix once.&lt;/p&gt;

&lt;p&gt;If you want a quick look at where your own domain stands, &lt;a href="https://email-fix-pack.pages.dev/?src=devto" rel="noopener noreferrer"&gt;Email Fix Pack&lt;/a&gt; has a free checker that reads your live SPF, DKIM and DMARC (disclosure: I made it).&lt;/p&gt;

</description>
      <category>email</category>
      <category>dns</category>
      <category>devops</category>
      <category>security</category>
    </item>
    <item>
      <title>Gmail 550 5.7.26 "unauthenticated sender": what it means and how to fix it</title>
      <dc:creator>Mogley1011</dc:creator>
      <pubDate>Tue, 20 Oct 2026 18:30:37 +0000</pubDate>
      <link>https://dev.to/mogley1011/gmail-550-5726-unauthenticated-sender-what-it-means-and-how-to-fix-it-540h</link>
      <guid>https://dev.to/mogley1011/gmail-550-5726-unauthenticated-sender-what-it-means-and-how-to-fix-it-540h</guid>
      <description>&lt;p&gt;If Gmail bounced your message with &lt;code&gt;550 5.7.26 This message does not have authentication information or fails to pass authentication checks&lt;/code&gt;, it is not a content problem. Gmail is telling you it could not verify who sent the mail. Here is how to find which check failed and fix it, in the order I would do it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Read the bounce, then the headers
&lt;/h2&gt;

&lt;p&gt;The bounce text names the failing mechanism. Look for "SPF", "DKIM" or "DMARC" in it. If you can get a delivered copy (send to a Gmail address you control that is not blocked), open "Show original" and read the &lt;code&gt;Authentication-Results&lt;/code&gt; line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight email"&gt;&lt;code&gt;&lt;span class="nt"&gt;spf=pass  dkim=pass  dmarc=pass
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You need SPF &lt;strong&gt;or&lt;/strong&gt; DKIM to pass, and for bulk senders both, and DMARC to pass with alignment. Anything else is what to fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. SPF: one record, under 10 lookups
&lt;/h2&gt;

&lt;p&gt;Check what you publish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig +short TXT yourdomain.com | &lt;span class="nb"&gt;grep &lt;/span&gt;spf1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Common faults:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Two SPF records.&lt;/strong&gt; There must be exactly one &lt;code&gt;v=spf1&lt;/code&gt; TXT record. Merge them into one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More than 10 DNS lookups.&lt;/strong&gt; Every &lt;code&gt;include:&lt;/code&gt;, &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;mx&lt;/code&gt; and &lt;code&gt;redirect&lt;/code&gt; counts. Over 10 gives &lt;code&gt;permerror&lt;/code&gt;, which Gmail treats as a fail. Remove providers you no longer use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sending service missing.&lt;/strong&gt; If your newsletter or invoicing tool sends as your domain, its &lt;code&gt;include:&lt;/code&gt; must be in the record.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ending in &lt;code&gt;+all&lt;/code&gt; or nothing.&lt;/strong&gt; Use &lt;code&gt;~all&lt;/code&gt; while you test and &lt;code&gt;-all&lt;/code&gt; once you are sure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. DKIM: sign with your own domain
&lt;/h2&gt;

&lt;p&gt;Gmail wants DKIM signed with a domain that matches your From address. Enable DKIM in your mail provider and publish the CNAME or TXT record it gives you, then confirm the selector resolves:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig +short TXT selector1._domainkey.yourdomain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A signature from the sender's own domain (for example a shared &lt;code&gt;d=sendgrid.net&lt;/code&gt;) passes DKIM but will not align with your From domain, so DMARC still fails.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. DMARC: publish it and make it align
&lt;/h2&gt;

&lt;p&gt;Add a TXT record at &lt;code&gt;_dmarc.yourdomain.com&lt;/code&gt;. Start in monitoring mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight email"&gt;&lt;code&gt;&lt;span class="nt"&gt;v=DMARC1; p=none; rua=mailto&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="na"&gt;dmarc-reports@yourdomain.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the aggregate reports for a couple of weeks, fix any legitimate sender that fails, then move to &lt;code&gt;p=quarantine&lt;/code&gt; and later &lt;code&gt;p=reject&lt;/code&gt;. Google's bulk-sender rules (more than 5,000 messages a day to Gmail) require DMARC, and it is the right baseline for everyone.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Test after DNS settles
&lt;/h2&gt;

&lt;p&gt;DNS changes can take up to an hour to be seen everywhere. Send a test to a Gmail address and check &lt;code&gt;Authentication-Results&lt;/code&gt; again. If &lt;code&gt;dmarc=pass&lt;/code&gt; and the bounce is gone, you are done.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you do not want to work through this by hand
&lt;/h2&gt;

&lt;p&gt;I built a free checker that reads your domain's live SPF, DKIM and DMARC and lists what is wrong. A paid fix pack generates the exact records for your mail provider and DNS host. Both are on &lt;a href="https://email-fix-pack.pages.dev/?src=devto" rel="noopener noreferrer"&gt;Email Fix Pack&lt;/a&gt; (disclosure: I made it). The error is covered in more detail &lt;a href="https://email-fix-pack.pages.dev/fix/gmail-550-5-7-26.html" rel="noopener noreferrer"&gt;on this page&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>email</category>
      <category>dns</category>
      <category>devops</category>
      <category>security</category>
    </item>
  </channel>
</rss>
