<p dir="ltr"><br>
On Nov 15, 2014 6:54 AM, &quot;Sam Varshavchik&quot; &lt;<a href="mailto:mrsam@courier-mta.com">mrsam@courier-mta.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Making the rounds of various technical mailing lists yesterday, with a subject that&#39;s typically a variation of &quot;Just for yucks, and giggles&quot; is a link to a commit to systemd&#39;s git, adding DNS caching to systemd; in one, huge 857 line glop. Here&#39;s its entire commit message: &quot;resolved: add DNS cache&quot;.<br>
&gt;<br>
&gt; And, it&#39;s beauty to read. Made me teary-eyed to know that systemd will cache my DNS queries. Not sure why systemd, all of a sudden, needs to make DNS queries. But if it does, it&#39;s going to cache them now! Such a sight to behold makes my heart skip a beat: now, not just bind, or pretty much every DNS server that automatically caches DNS for you – but so will systemd!<br>
&gt;<br>
&gt; But, seriously folks, systemd&#39;s DNS caching achieves absolutely 100% nothing. Really. Surprised? Well, you&#39;ll be shocked to know that the DNS server that systemd queries for that DNS RR, such as the stock &quot;bind&quot;, already automatically caches all recursive DNS replies!! systemd&#39;s own caching produces absolutely zero useful results. On the oft chance that it sends a query for a non-cached RR, the local DNS server will cache the response, before returning it to systemd, and then use the cached response for all future queries. That&#39;s what DNS servers do: provide caching for local clients. It&#39;s inherent in DNS&#39;s design: DNS was explicitly designed to use aggressive caching, it&#39;s an internet-wide, distributed, locally cached database.<br>
&gt;<br>
&gt; Isn&#39;t modern technology amazing?<br>
&gt;<br>
&gt; I&#39;m willing to consider the possibility that I missed something obvious, some obvious value-added result from caching DNS RRs directly by systemd, and I&#39;ll stick around for someone to enlighten me; or if Occam&#39;s razor applies, and the author of that commit had no idea that bind already automatically caches DNS responses, and, more importantly, that its caching algorithms are a result of painful lessons learned from various DNS cache poisoning attacks, that have circulated around the intertubes, for the last couple of years.<br>
&gt;<br>
&gt; The only possible use case for this kind of caching approach would be if:<br>
&gt;<br>
&gt; A) You do not have a local DNS server nearby; and you have non-negligible latencies to whatever DNS server you use.<br>
&gt;<br>
&gt; B) Your queries tend to be for domains that your DNS servers are not authoritative for, so they&#39;ll benefit from local caching.<br>
&gt;<br>
&gt; So, can someone explain to me how likely this is going to be the case in a typical deployment scenario that systemd is targeted for; in an average corporate environment where systemd&#39;s alleged benefits will supposedly shine?<br>
&gt;<br>
&gt; I would guess that a typical systemd deployment, in a corporate/business environment, will certainly have multiple, low-latency DNS servers nearby, won&#39;t that be the case? And, if so, then this is just another potentially exploitable security hole in systemd, nothing more.<br>
&gt;<br>
&gt; P.S. After I wrote the above, poking around, Google dumped this onto my screen:<br>
&gt;<br>
&gt; <a href="http://seclists.org/oss-sec/2014/q4/592">http://seclists.org/oss-sec/2014/q4/592</a><br>
&gt;<br>
&gt; Mental note to myself: go back and check the timestamp of the systemd git commit – before, or after, this was disclosed…<br>
&gt;<br>
&gt;<br>
&gt; --</p>
<p dir="ltr">I haven&#39;t read into it much yet, but the vast majority of systemd network functionality is intended almost exclusively to support networking in systemd-nspawn containers.  The init system&#39;s job is to isolate and manage services; container management is a logical add.</p>
<p dir="ltr">Whatever the intent, I hope that everyone discovers it from reading actual documentation instead of inflammatory comments on indignant speculation about the intent behind a one sentence feature description like &quot;<br>
resolved: add DNS cache &quot;.  I&#39;m not necessarily putting you in that box, Sam, but these discussions tend to feed on themselves and it makes productive discourse difficult.</p>
<p dir="ltr">--Pete</p>