<?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: AGuard.lt</title>
    <description>The latest articles on DEV Community by AGuard.lt (@aguardlt).</description>
    <link>https://dev.to/aguardlt</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%2F4258546%2F4b0106f2-15c5-4d62-941c-f2892433766a.png</url>
      <title>DEV Community: AGuard.lt</title>
      <link>https://dev.to/aguardlt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aguardlt"/>
    <language>en</language>
    <item>
      <title>Cloudflare's DNS API accepted four of five broken mail setups I gave it</title>
      <dc:creator>AGuard.lt</dc:creator>
      <pubDate>Tue, 24 Nov 2026 14:37:51 +0000</pubDate>
      <link>https://dev.to/aguardlt/cloudflares-dns-api-accepted-four-of-five-broken-mail-setups-i-gave-it-4p8f</link>
      <guid>https://dev.to/aguardlt/cloudflares-dns-api-accepted-four-of-five-broken-mail-setups-i-gave-it-4p8f</guid>
      <description>&lt;p&gt;Email that dies right after a domain moves to Cloudflare gets blamed on "propagation". The other suspect is a record that Cloudflare saved without complaint and that cannot work for mail.&lt;/p&gt;

&lt;p&gt;So I tested where the line is. On 24 November 2026 I entered five questionable mail setups into a live Cloudflare zone (Free plan) through the DNS API, on a test subdomain, and wrote down what came back. The test records were deleted afterwards.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was entered and what Cloudflare answered
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I entered&lt;/th&gt;
&lt;th&gt;Cloudflare's answer&lt;/th&gt;
&lt;th&gt;Result for mail&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MX with an IP address as content&lt;/td&gt;
&lt;td&gt;Refused, error 9009: "Change the content of your MX record to be a hostname (and not an IP address)"&lt;/td&gt;
&lt;td&gt;None, the record is not created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MX pointing to a name that is a CNAME&lt;/td&gt;
&lt;td&gt;Accepted, no warning&lt;/td&gt;
&lt;td&gt;Invalid MX target under RFC 2181, section 10.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two SPF records on one name&lt;/td&gt;
&lt;td&gt;Accepted, no warning&lt;/td&gt;
&lt;td&gt;SPF &lt;code&gt;permerror&lt;/code&gt; (RFC 7208, section 4.5)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A record of the mail host set to Proxied&lt;/td&gt;
&lt;td&gt;Accepted, no warning&lt;/td&gt;
&lt;td&gt;Ports 25, 587 and 993 do not answer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MX pointing to a proxied name&lt;/td&gt;
&lt;td&gt;Accepted; answers carry a generated &lt;code&gt;_dc-mx&lt;/code&gt; name&lt;/td&gt;
&lt;td&gt;Senders are sent to the server directly, so its address is visible&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One refusal out of five. Saving is not validation: a record that saves is not a record that works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two that stop mail
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mail host behind the proxy.&lt;/strong&gt; The orange cloud passes HTTP ports, not mail ports. If &lt;code&gt;mail.example.com&lt;/code&gt; is proxied, its A record returns Cloudflare addresses and nothing listens there on 25, 587 or 993:&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 A mail.example.com
nc -vz -w 5 mail.example.com 587
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the addresses belong to Cloudflare (its ranges are published at cloudflare.com/ips) and the port test times out, set that one record to DNS only. The website can stay proxied.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two SPF records.&lt;/strong&gt; A typical way to get here: a new service is added and its &lt;code&gt;v=spf1&lt;/code&gt; line is pasted as a second TXT record instead of being merged into the first one. RFC 7208 says a domain with more than one SPF record gets &lt;code&gt;permerror&lt;/code&gt;, and receivers treat that as a failed check:&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 example.com &lt;span class="o"&gt;|&lt;/span&gt; grep spf1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two lines in the answer means one record too many. Merge the mechanisms into a single record.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one that is a finding, not a breakage
&lt;/h2&gt;

&lt;p&gt;MX pointing to a proxied name does not stop mail. Cloudflare answers with a generated &lt;code&gt;_dc-mx&lt;/code&gt; name that resolves to the real server, so delivery works. The side effect is that the address you hid behind the proxy is readable by anyone who asks for the MX record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does it show in real zones?
&lt;/h2&gt;

&lt;p&gt;It shows as a correlation. In an open dataset of .lt websites I maintain, 28.4 % of mail domains whose website answers from Cloudflare's network have no SPF record at all (2,059 of 7,253). Among the rest it is 11.5 % (6,626 of 57,657). DMARC goes the other way: it is missing on 58.3 % of the Cloudflare group and on 69.8 % of the rest. The dataset records where the website answers from, not who hosts the DNS zone or when it was moved, so this says the two go together and nothing about cause.&lt;/p&gt;

&lt;h2&gt;
  
  
  If mail already stopped
&lt;/h2&gt;

&lt;p&gt;The API test covers three of the causes. The rest are DNSSEC left on at the registrar, records lost in the import, a missing DKIM record and Email Routing taking over the MX records. I wrote up &lt;a href="https://aguard.lt/en/wiki/cloudflare-email-not-working-after-dns-move" rel="noopener noreferrer"&gt;the four commands that tell these causes apart&lt;/a&gt;, with the answer each cause gives and the fix for each.&lt;/p&gt;

&lt;p&gt;Sources: &lt;a href="https://developers.cloudflare.com/dns/proxy-status/" rel="noopener noreferrer"&gt;Cloudflare Docs, proxy status&lt;/a&gt;, &lt;a href="https://developers.cloudflare.com/fundamentals/reference/network-ports/" rel="noopener noreferrer"&gt;Cloudflare Docs, network ports&lt;/a&gt;, &lt;a href="https://www.rfc-editor.org/rfc/rfc7208.txt" rel="noopener noreferrer"&gt;RFC 7208&lt;/a&gt;, &lt;a href="https://www.rfc-editor.org/rfc/rfc2181.txt" rel="noopener noreferrer"&gt;RFC 2181&lt;/a&gt;, dataset &lt;a href="https://doi.org/10.5281/zenodo.24282573" rel="noopener noreferrer"&gt;doi:10.5281/zenodo.24282573&lt;/a&gt; (CC BY 4.0).&lt;/p&gt;

</description>
      <category>cloudflare</category>
      <category>dns</category>
      <category>email</category>
      <category>devops</category>
    </item>
    <item>
      <title>68.5% of .lt domains have no DMARC record: what a scan of 64,910 domains shows</title>
      <dc:creator>AGuard.lt</dc:creator>
      <pubDate>Sun, 22 Nov 2026 09:52:36 +0000</pubDate>
      <link>https://dev.to/aguardlt/685-of-lt-domains-have-no-dmarc-record-what-a-scan-of-64910-domains-shows-18j3</link>
      <guid>https://dev.to/aguardlt/685-of-lt-domains-have-no-dmarc-record-what-a-scan-of-64910-domains-shows-18j3</guid>
      <description>&lt;p&gt;I run a small website security service in Lithuania. In November I checked the mail records of every &lt;code&gt;.lt&lt;/code&gt; domain I could find, 64,910 of them, and published the result as an open dataset. This post is about one column of it: the DMARC policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;DMARC policy&lt;/th&gt;
&lt;th&gt;Domains&lt;/th&gt;
&lt;th&gt;Share&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No record at all&lt;/td&gt;
&lt;td&gt;44,466&lt;/td&gt;
&lt;td&gt;68.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;p=none&lt;/code&gt; (monitoring only)&lt;/td&gt;
&lt;td&gt;16,412&lt;/td&gt;
&lt;td&gt;25.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;p=quarantine&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2,440&lt;/td&gt;
&lt;td&gt;3.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;p=reject&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1,588&lt;/td&gt;
&lt;td&gt;2.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;SPF looks much better: 86.6% of the same domains publish an SPF record.&lt;/p&gt;

&lt;p&gt;So the typical Lithuanian domain says which servers may send its mail, and then says nothing about what a receiver should do when a message fails that check. Only 6.2% of domains ask receivers to act on a failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the gap between SPF and DMARC
&lt;/h2&gt;

&lt;p&gt;Three explanations fit what the table shows. They are my reading, not something the data proves.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SPF arrives by default.&lt;/strong&gt; Many hosting control panels create an SPF record when the domain is added. Nobody decides to publish it. DMARC is almost never created for you, so somebody has to know it exists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;p=none&lt;/code&gt; is where people stop.&lt;/strong&gt; A quarter of all domains have a DMARC record that only monitors. That is the right first step, because it lets you collect reports before you start rejecting mail. But if nobody reads the reports, the second step never happens, and a &lt;code&gt;p=none&lt;/code&gt; record that stays forever protects nothing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Small senders feel no pressure.&lt;/strong&gt; Since February 2024 Gmail and Yahoo require a DMARC record from anyone who sends more than 5,000 messages a day to their users. A company that sends forty invoices a month is far below that line, and its mail keeps arriving, so the record stays missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "no DMARC" means in practice
&lt;/h2&gt;

&lt;p&gt;It does not mean the domain is hacked or that its mail is insecure in transit. It means that anyone can put &lt;code&gt;accounting@that-domain.lt&lt;/code&gt; in the From line, and the receiving server has no instruction from the domain owner to treat the message as forged.&lt;/p&gt;

&lt;p&gt;The fraud this enables is rarely clever: an invoice with a changed bank account number, sent "from" a supplier the victim already trusts. The supplier's own systems are never touched.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the data does not show
&lt;/h2&gt;

&lt;p&gt;A few limits, so the numbers are not stretched further than they go:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only registered domains are counted, not subdomains.&lt;/li&gt;
&lt;li&gt;A domain with no DMARC record may send no mail at all. It can still be impersonated, but the owner may reasonably not care.&lt;/li&gt;
&lt;li&gt;DKIM is not in the table. A selector name cannot be discovered from outside, so any DKIM figure from a scan like this would be a guess.&lt;/li&gt;
&lt;li&gt;The domain list comes from Common Crawl, not from the registry zone file. It leans towards domains that are linked from somewhere.&lt;/li&gt;
&lt;li&gt;Nothing was sent. These are DNS lookups only.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  If you have a domain without one
&lt;/h2&gt;

&lt;p&gt;Start with monitoring and an address you actually read:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the reports for a few weeks. Find every service that sends mail in your name (the shop, the newsletter tool, the accounting system) and make sure each one passes SPF or DKIM with your domain. Then move to &lt;code&gt;p=quarantine&lt;/code&gt;, and later to &lt;code&gt;p=reject&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The part people skip is the calendar entry that says "raise the policy". Without it you join the 25%.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data
&lt;/h2&gt;

&lt;p&gt;The table above, with the method, is here: &lt;a href="https://aguard.lt/en/data/email-authentication" rel="noopener noreferrer"&gt;How many .lt domains publish DMARC and SPF records?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The whole dataset covers 125,935 &lt;code&gt;.lt&lt;/code&gt; hostnames: platforms, WordPress and PHP versions, exposed files, mail records. It is anonymised (no domain names or IP addresses) and published under CC BY 4.0 on &lt;a href="https://doi.org/10.5281/zenodo.24282573" rel="noopener noreferrer"&gt;Zenodo&lt;/a&gt; and &lt;a href="https://github.com/aguardlt/lt-web-security-survey" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I would like to compare this with other country domains. If you have run the same check on &lt;code&gt;.lv&lt;/code&gt;, &lt;code&gt;.ee&lt;/code&gt;, &lt;code&gt;.pl&lt;/code&gt; or anything else, tell me what you saw.&lt;/p&gt;

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