<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Dns – Yeri Tiete</title>
    <link>https://yeri.be/tag/dns/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Fri, 17 Feb 2023 22:40:09 +0100</lastBuildDate>
    <atom:link href="https://yeri.be/tag/dns/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>NextDNS and NetworkManager</title>
      <link>https://yeri.be/nextdns-and-networkmanager/</link>
      <pubDate>Fri, 17 Feb 2023 22:40:09 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nextdns-and-networkmanager/</guid>
      <description>&lt;p&gt;A while back, I &lt;a href=&#34;https://yeri.be/networkmanager-exit-status-1&#34;&gt;wrote about installing&lt;/a&gt; NetworkManager if &lt;a href=&#34;https://yeri.be/tag/nextdns&#34;&gt;NextDNS&lt;/a&gt; activate fails to work. &lt;/p&gt;&#xA;&lt;p&gt;Only... I realised that for some reason on Raspberry Pi (4), WiFi stopped working with the following errors:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.2204] device (wlan0): state change: config -&amp;gt; failed (reason &#39;ssid-not-found&#39;, sys-iface-state: &#39;managed&#39;)&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7525] device (wlan0): set-hw-addr: set MAC address to 92:F3:ED:C2:8F:9B (scanning)&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;warn&amp;gt;  &amp;#91;1676631302.7559] device (wlan0): Activation: failed for connection &#39;superuser.one&#39;&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7562] device (wlan0): supplicant interface state: scanning -&amp;gt; disconnected&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7562] device (p2p-dev-wlan0): supplicant management interface state: scanning -&amp;gt; disconnected&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7577] device (wlan0): supplicant interface state: disconnected -&amp;gt; interface_disabled&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7578] device (p2p-dev-wlan0): supplicant management interface state: disconnected -&amp;gt; interface_disabled&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7579] device (wlan0): supplicant interface state: interface_disabled -&amp;gt; disconnected&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7579] device (p2p-dev-wlan0): supplicant management interface state: interface_disabled -&amp;gt; disconnected&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7585] device (wlan0): state change: failed -&amp;gt; disconnected (reason &#39;none&#39;, sys-iface-state: &#39;managed&#39;)&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The WiFi SSID and password (&lt;code&gt;wpa_supplicant&lt;/code&gt;) never changed, so I wasn&#39;t sure what it was. However, as most Pi&#39;s are wired I didn&#39;t pay much attention, until today.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>A while back, I <a href="https://yeri.be/networkmanager-exit-status-1">wrote about installing</a> NetworkManager if <a href="https://yeri.be/tag/nextdns">NextDNS</a> activate fails to work. </p>
<p>Only... I realised that for some reason on Raspberry Pi (4), WiFi stopped working with the following errors:</p>
<pre class="wp-block-code"><code>Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.2204] device (wlan0): state change: config -&gt; failed (reason 'ssid-not-found', sys-iface-state: 'managed')
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7525] device (wlan0): set-hw-addr: set MAC address to 92:F3:ED:C2:8F:9B (scanning)
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;warn&gt;  &#91;1676631302.7559] device (wlan0): Activation: failed for connection 'superuser.one'
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7562] device (wlan0): supplicant interface state: scanning -&gt; disconnected
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7562] device (p2p-dev-wlan0): supplicant management interface state: scanning -&gt; disconnected
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7577] device (wlan0): supplicant interface state: disconnected -&gt; interface_disabled
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7578] device (p2p-dev-wlan0): supplicant management interface state: disconnected -&gt; interface_disabled
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7579] device (wlan0): supplicant interface state: interface_disabled -&gt; disconnected
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7579] device (p2p-dev-wlan0): supplicant management interface state: interface_disabled -&gt; disconnected
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7585] device (wlan0): state change: failed -&gt; disconnected (reason 'none', sys-iface-state: 'managed')</code></pre>
<p>The WiFi SSID and password (<code>wpa_supplicant</code>) never changed, so I wasn't sure what it was. However, as most Pi's are wired I didn't pay much attention, until today.</p>
<p>As I had one RPi where <code>nextdns activate</code> worked fine, without NetworkManager installed, and where WiFi worked, I figured there was something evil about NetworkManager (= breaks my WiFi) and NextDNS not actually needing it... </p>
<p>I reverted my changed from my previous post (and removed some extra stuff that was not needed in my case, YMMV):</p>
<div class="wp-block-comments">
<pre class="wp-block-code"><code>apt purge -y network-manager dnsmasq-base resolvconf modemmanager ppp ; apt install -y powermgmt-base openresolv ; apt autoremove -y</code></pre>
</div>
<pre class="wp-block-verse">The powermgmt-base, and modemmanager, ppp parts are likely not needed, but this is just a copy and paste of what I did.</pre>
<p>Reboot... And WiFi worked again. However, <code>nextdns activate</code> would still throw an error:</p>
<pre class="wp-block-code"><code># nextdns activate
Error: NetworkManager resolver management: exit status 5</code></pre>
<p>Going through <a rel="noreferrer noopener" href="https://github.com/nextdns/nextdns/blob/master/host/dns_linux.go" target="_blank">the source code</a> (yay for open-source) I noticed:</p>
<pre class="wp-block-code"><code>var networkManagerFile = "/etc/NetworkManager/conf.d/nextdns.conf"</code></pre>
<p>That file indeed existed on both RPis that had the <code>activate</code> issue.</p>
<p>I ran the following command...</p>
<pre class="wp-block-code"><code>rm /etc/NetworkManager/conf.d/nextdns.conf</code></pre>
<p>But that still gave the same error. But as I had purged the entire NetworkManager, I didn't need its lingering config files... So, why not rid ourselves of everything:</p>
<pre class="wp-block-code"><code>rm -r /etc/NetworkManager</code></pre>
<p>And tada... Now <code>activate</code> works fine:</p>
<pre class="wp-block-code"><code>tyr ~ # nextdns activate
tyr ~ #</code></pre>
<p>Go figure ¯\_(ツ)_/¯ </p>
]]></content:encoded>
      <category>Errors</category><category>Linux</category><category>Software</category>
      <category>dns</category><category>nextdns</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>NetworkManager exit status 1</title>
      <link>https://yeri.be/networkmanager-exit-status-1/</link>
      <pubDate>Mon, 26 Dec 2022 21:19:59 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/networkmanager-exit-status-1/</guid>
      <description>&lt;p&gt;Recently reinstalled &lt;a href=&#34;https://yeri.be/tag/nextdns&#34;&gt;NextDNS&lt;/a&gt; on a RPi4 64bit and came across this error:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;# nextdns activate&#xA;Error: NetworkManager resolver management: exit status 1&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It seems like &lt;a href=&#34;https://nextdns.io/?from=tuts3r6c&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;NextDNS&lt;/a&gt; was actually running, but just throwing an error when running &lt;code&gt;nextdns activate&lt;/code&gt;. Restarting did seem to work without throwing any error.&lt;/p&gt;&#xA;&lt;p&gt;The logs showed the same error:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;Dec 20 14:06:20 tyr nextdns&amp;#91;5753]: Starting NextDNS 1.38.0/linux on :53&#xA;Dec 20 14:06:20 tyr nextdns&amp;#91;5753]: Listening on TCP/:53&#xA;Dec 20 14:06:20 tyr nextdns&amp;#91;5753]: Starting mDNS discovery&#xA;Dec 20 14:06:20 tyr nextdns&amp;#91;5753]: Listening on UDP/:53&#xA;Dec 20 14:06:21 tyr nextdns&amp;#91;5753]: Connected 45.90.28.0:443 (con=13ms tls=58ms, TCP, TLS13)&#xA;Dec 20 14:06:21 tyr nextdns&amp;#91;5753]: Connected 185.18.148.91:443 (con=12ms tls=28ms, TCP, TLS13)&#xA;Dec 20 14:06:21 tyr nextdns&amp;#91;5753]: Switching endpoint: https://dns.nextdns.io#185.18.148.91,2a04:b80:1:30::2&#xA;Dec 20 14:06:25 tyr nextdns&amp;#91;5753]: Setting up router&#xA;Dec 20 14:06:25 tyr nextdns&amp;#91;5753]: Activating&#xA;Dec 20 14:06:25 tyr nextdns&amp;#91;5753]: Activate: NetworkManager resolver management: exit status 1&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The solution was (as root):&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Recently reinstalled <a href="https://yeri.be/tag/nextdns">NextDNS</a> on a RPi4 64bit and came across this error:</p>
<pre class="wp-block-code"><code># nextdns activate
Error: NetworkManager resolver management: exit status 1</code></pre>
<p>It seems like <a href="https://nextdns.io/?from=tuts3r6c" target="_blank" rel="noreferrer noopener">NextDNS</a> was actually running, but just throwing an error when running <code>nextdns activate</code>. Restarting did seem to work without throwing any error.</p>
<p>The logs showed the same error:</p>
<pre class="wp-block-code"><code>Dec 20 14:06:20 tyr nextdns&#91;5753]: Starting NextDNS 1.38.0/linux on :53
Dec 20 14:06:20 tyr nextdns&#91;5753]: Listening on TCP/:53
Dec 20 14:06:20 tyr nextdns&#91;5753]: Starting mDNS discovery
Dec 20 14:06:20 tyr nextdns&#91;5753]: Listening on UDP/:53
Dec 20 14:06:21 tyr nextdns&#91;5753]: Connected 45.90.28.0:443 (con=13ms tls=58ms, TCP, TLS13)
Dec 20 14:06:21 tyr nextdns&#91;5753]: Connected 185.18.148.91:443 (con=12ms tls=28ms, TCP, TLS13)
Dec 20 14:06:21 tyr nextdns&#91;5753]: Switching endpoint: https://dns.nextdns.io#185.18.148.91,2a04:b80:1:30::2
Dec 20 14:06:25 tyr nextdns&#91;5753]: Setting up router
Dec 20 14:06:25 tyr nextdns&#91;5753]: Activating
Dec 20 14:06:25 tyr nextdns&#91;5753]: Activate: NetworkManager resolver management: exit status 1</code></pre>
<p>The solution was (as root):</p>
<pre class="wp-block-code"><code>apt install network-manager resolvconf -y
systemctl enable NetworkManager
systemctl start NetworkManager
nextdns activate</code></pre>
<p>Looks like, instead of <code>resolvconf</code>, <code>openresolv</code> was installed. </p>
<p>First time I heard about <a rel="noreferrer noopener" href="https://wiki.archlinux.org/title/Openresolv" target="_blank">openresolv</a>; usually resolvconf is the default. Not entirely sure if this was the culprit (and NetworkManager not being started) but the errors are now gone. </p>
]]></content:encoded>
      <category>Errors</category><category>Linux</category><category>Software</category>
      <category>dns</category><category>nextdns</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Sony stops DNS resolvers</title>
      <link>https://yeri.be/sony-stops-dns-resolvers/</link>
      <pubDate>Wed, 01 Dec 2021 10:08:59 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/sony-stops-dns-resolvers/</guid>
      <description>&lt;blockquote class=&#34;wp-block-quote&#34;&gt;&lt;p&gt;The Hamburg Regional Court today ruled that they would not suspend an existing injunction against &lt;a href=&#34;https://www.quad9.net/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;Quad9&lt;/a&gt; in a case filed by Sony Music Germany. The case centers around Sony Music’s demand that Quad9’s servers located in Germany stop resolving DNS names of third-party sites which are claimed to have URLs that contain copyright infringements.&lt;/p&gt;&lt;cite&gt;&lt;em&gt;&lt;a href=&#34;https://www.quad9.net/news/press/german-court-rules-against/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;Source&lt;/a&gt;&lt;/em&gt;.&lt;/cite&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Unbelievable. &lt;/p&gt;&#xA;&lt;p&gt;Also note &#34;&lt;em&gt;claimed&lt;/em&gt; to have&#34;. Not &lt;em&gt;proven&lt;/em&gt; to have. &lt;/p&gt;&#xA;&lt;p&gt;Knowing that Sony has not been very good at actually identifying copyrighted content, and they just throw stuff around to see what sticks. &lt;/p&gt;</description>
      <content:encoded><![CDATA[<blockquote class="wp-block-quote"><p>The Hamburg Regional Court today ruled that they would not suspend an existing injunction against <a href="https://www.quad9.net/" target="_blank" rel="noreferrer noopener">Quad9</a> in a case filed by Sony Music Germany. The case centers around Sony Music’s demand that Quad9’s servers located in Germany stop resolving DNS names of third-party sites which are claimed to have URLs that contain copyright infringements.</p><cite><em><a href="https://www.quad9.net/news/press/german-court-rules-against/" target="_blank" rel="noreferrer noopener">Source</a></em>.</cite></blockquote>
<p>Unbelievable. </p>
<p>Also note "<em>claimed</em> to have". Not <em>proven</em> to have. </p>
<p>Knowing that Sony has not been very good at actually identifying copyrighted content, and they just throw stuff around to see what sticks. </p>
<p>And <a href="https://www.eff.org/wp/unintended-consequences-under-dmca" target="_blank" rel="noreferrer noopener">DMCA</a> requests have done more evil than good... </p>
<p>Also, what will actually happen? Quad9 will move its DNS servers outside of Germany and/or people will use other DNS resolvers. Nothing get fixed, and users are punished with worse latency. </p>
]]></content:encoded>
      <category>Networking</category><category>Software</category>
      <category>WTF</category><category>dns</category><category>europe</category><category>law</category><category>politics</category><category>warez</category>
    </item>
    
    <item>
      <title>0x04</title>
      <link>https://yeri.be/0x04/</link>
      <pubDate>Sun, 17 May 2020 18:15:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/0x04/</guid>
      <description>&lt;p&gt;Almost 10 years after I registered &lt;a aria-label=&#34;0x04.com (opens in a new tab)&#34; href=&#34;https://yeri.be/blog-changes&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;0x04.com&lt;/a&gt;, it&#39;s time to part ways.&lt;/p&gt;&#xA;&lt;div class=&#34;wp-block-image&#34;&gt;&lt;figure class=&#34;aligncenter size-large&#34;&gt;&lt;a href=&#34;https://static.yeri.be/2020/05/whois-0x04.com_.png&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;img src=&#34;https://static.yeri.be/2020/05/whois-0x04.com_-943x1024.png&#34; alt=&#34;0x04.com whois&#34; class=&#34;wp-image-8885&#34;/&gt;&lt;/a&gt;&lt;figcaption&gt;&lt;em&gt;old whois info -- created 29 Aug 2010. &lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;/div&gt;&#xA;&lt;p&gt;Yesterday I finalised the sale of 0x04.com.&lt;/p&gt;&#xA;&lt;p&gt;My company in Singapore was called 0x04 pte. ltd. and to avoid any confusion I&#39;ve renamed to su1 pte. ltd. su1 standing for &lt;a href=&#34;http://Superuser.one&#34; target=&#34;_blank&#34; aria-label=&#34;Superuser.one (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;Superuser.one&lt;/a&gt;. 🤷‍♂️&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Almost 10 years after I registered <a aria-label="0x04.com (opens in a new tab)" href="https://yeri.be/blog-changes" target="_blank" rel="noreferrer noopener" class="aioseop-link">0x04.com</a>, it's time to part ways.</p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/05/whois-0x04.com_.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/05/whois-0x04.com_-943x1024.png" alt="0x04.com whois" class="wp-image-8885"/></a><figcaption><em>old whois info -- created 29 Aug 2010. </em></figcaption></figure></div>
<p>Yesterday I finalised the sale of 0x04.com.</p>
<p>My company in Singapore was called 0x04 pte. ltd. and to avoid any confusion I've renamed to su1 pte. ltd. su1 standing for <a href="http://Superuser.one" target="_blank" aria-label="Superuser.one (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Superuser.one</a>. 🤷‍♂️</p>
]]></content:encoded>
      <category>Misc</category><category>Networking</category>
      <category>0x04</category><category>dns</category>
    </item>
    
    <item>
      <title>NextDNS, EdgeOS and device names</title>
      <link>https://yeri.be/nextdns-edgeos-and-device-names/</link>
      <pubDate>Fri, 15 May 2020 13:02:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nextdns-edgeos-and-device-names/</guid>
      <description>&lt;p&gt;Noticed that NextDNS was reporting old hostnames in the logs. For example old device names (devices that changed hostnames), devices that were definitely no longer on the network, or IPs that were matched to the wrong hostnames.&lt;/p&gt;&#xA;&lt;p&gt;The culprit is how EdgeOS deals with its &lt;a aria-label=&#34;hosts file (opens in a new tab)&#34; href=&#34;https://en.wikipedia.org/wiki/Hosts_%28file%29&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;hosts file&lt;/a&gt;. Basically it just keeps all the old hosts added and just adds a new line at the end of the file. &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Noticed that NextDNS was reporting old hostnames in the logs. For example old device names (devices that changed hostnames), devices that were definitely no longer on the network, or IPs that were matched to the wrong hostnames.</p>
<p>The culprit is how EdgeOS deals with its <a aria-label="hosts file (opens in a new tab)" href="https://en.wikipedia.org/wiki/Hosts_%28file%29" target="_blank" rel="noreferrer noopener" class="aioseop-link">hosts file</a>. Basically it just keeps all the old hosts added and just adds a new line at the end of the file. </p>
<p>NextDNS searches for the first valid entry in that file, which is always going to be an older record.</p>
<p>So the simplest solution I found was the turn off <code>hostfile-update</code> every so often. This clears the hosts file. </p>
<p>So <code>ssh</code> into the device, run <code>configure</code>, and then run these commands:</p>
<pre class="wp-block-code"><code>set service dhcp-server hostfile-update disable
commit
set service dhcp-server hostfile-update enable
commit
save</code></pre>
<h2 class="wp-block-heading">Update 22 Jun '23:</h2>
<p>Be sure to restart NextDNS, or it won't actually publish the up-to-date client hostnames.</p>
<pre class="wp-block-code"><code>sudo /config/nextdns/nextdns restart</code></pre>
]]></content:encoded>
      <category>Linux</category><category>Networking</category><category>Software</category>
      <category>dns</category><category>nextdns</category><category>router</category><category>ubiquiti</category>
    </item>
    
    <item>
      <title>NextDNS &#43; EdgeRouter &#43; Redirecting DNS requests</title>
      <link>https://yeri.be/nextdns-edgerouter-redirecting-dns-requests/</link>
      <pubDate>Tue, 21 Apr 2020 18:14:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nextdns-edgerouter-redirecting-dns-requests/</guid>
      <description>&lt;p&gt;Realised I haven&#39;t updated this in a long while (life happened).&lt;/p&gt;&#xA;&lt;p&gt;Couple of weeks ago I started to play with &lt;a href=&#34;http://nextdns.io&#34; target=&#34;_blank&#34; aria-label=&#34; (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;NextDNS&lt;/a&gt; -- and I really recommend anyone that&#39;s something privacy minded and cares about the stuff happening on their network. &lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve set up several configs (home, parents, FlatTurtle &lt;a aria-label=&#34; (opens in a new tab)&#34; href=&#34;https://blog.flatturtle.com/image/103073818135&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;TurtleBox&lt;/a&gt; (the NUCs controlling the &lt;a aria-label=&#34; (opens in a new tab)&#34; href=&#34;https://flatturtle.com/screens&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;screens&lt;/a&gt;)) and Servers. Once it&#39;s out of beta and better supported on Unifi and Ubiquiti hardware I might deploy it to our &lt;a aria-label=&#34; (opens in a new tab)&#34; href=&#34;https://blog.flatturtle.com/image/101035897937&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;public WiFi&lt;/a&gt; (well, most access points don&#39;t look like that -- but you get the point) networks too. &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Realised I haven't updated this in a long while (life happened).</p>
<p>Couple of weeks ago I started to play with <a href="http://nextdns.io" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">NextDNS</a> -- and I really recommend anyone that's something privacy minded and cares about the stuff happening on their network. </p>
<p>I've set up several configs (home, parents, FlatTurtle <a aria-label=" (opens in a new tab)" href="https://blog.flatturtle.com/image/103073818135" target="_blank" rel="noreferrer noopener" class="aioseop-link">TurtleBox</a> (the NUCs controlling the <a aria-label=" (opens in a new tab)" href="https://flatturtle.com/screens" target="_blank" rel="noreferrer noopener" class="aioseop-link">screens</a>)) and Servers. Once it's out of beta and better supported on Unifi and Ubiquiti hardware I might deploy it to our <a aria-label=" (opens in a new tab)" href="https://blog.flatturtle.com/image/101035897937" target="_blank" rel="noreferrer noopener" class="aioseop-link">public WiFi</a> (well, most access points don't look like that -- but you get the point) networks too. </p>
<p>Looking at the logs was an eye-opener seeing what goes through your network. You can play around and block (or whitelist) certain domains. </p>
<figure class="wp-block-image size-large"><a href="https://static.yeri.be/2020/04/nextdns_0x04.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/04/nextdns_0x04-902x1024.png" alt="" class="wp-image-8310"/></a></figure>
<p>I figured out my <a href="https://www.devialet.com" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Devialet</a> does an insane amount of requests to <a href="http://cache.radioline.fr" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">cache.radioline.fr</a> for example. This domain has a 30s TTL. It shows that the majority of my DNS requests are actually automated pings and not in any way human traffic. </p>
<p>Anyhow -- I've since installed the <a href="https://github.com/nextdns/nextdns/wiki/EdgeOS" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">NextDNS CLI</a> straight on my <a href="https://yeri.be/edgerouter-fritzbox-ipsec" class="aioseop-link">EdgeRouter</a> Lite acting as a caching DNS server and forwarding using <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">DoH</a>. </p>
<p>I've turned off dnsmasq (<code>/etc/default/dnsmasq</code> =&gt; <code>DNSMASQ_OPTS="-p0"</code>) and have NextDNS listen to :53 directly. </p>
<p>Note that every EdgeOS update seems to wipe out the NextDNS installation, and requires a fresh install... Pain in the ass and doesn't seem like that's fixable. </p>
<p>This is my ERL NextDNS config (<code>/etc/nextdns.conf</code>)</p>
<pre class="wp-block-preformatted">hardened-privacy false
bogus-priv true
log-queries false
cache-size 10MB
cache-max-age 0s
report-client-info true
timeout 5s
listen :53
use-hosts true
setup-router false
auto-activate true
config 34xyz8
detect-captive-portals false
max-ttl 0s</pre>
<p>The explanation of every flag is explain on their <a href="https://github.com/nextdns/nextdns/" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Github</a> page and they are very responsive via issues or through their chat on <a href="http://my.nextdns.io" target="_blank" aria-label="my.nextdns.io (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">my.nextdns.io</a>.  </p>
<p>All right -- next thing I've noticed is that my Google Home devices are not sending any DNS requests -- which means the devices use hard coded DNS servers. </p>
<p>I have a separate vlan (<code>eth1.90</code>) for Google Home (includes my Android TV, <a aria-label=" (opens in a new tab)" href="https://osmc.tv/" target="_blank" rel="noreferrer noopener" class="aioseop-link">OSMC</a>, Nest Home Hub and all other GHome and Chromecast devices). For this vlan I set up a deflector to be able to cast and ping/ssh from my "main" network/vlan to GHome vlan. </p>
<p>Using <a href="https://iperf.io/2019/12/27/intercept-and-redirect-dns-requests/" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">this guide</a> I redirected all external DNS traffic to the ERL so I can monitor what's happening. The important part was the following:</p>
<pre class="wp-block-preformatted">yeri@sg-erl# show service nat rule 4053<br />destination {<br />port 53<br />}<br />inbound-interface eth1.90<br />inside-address {<br />address 10.3.34.1<br />port 53<br />}<br />protocol tcp_udp<br />type destination</pre>
<p>This allows to "catch" all UDP and TCP connections to :53 and redirect them the ERL DNS server (10.3.34.1). The GHome devices were acting a bit weird after committing the change, but a reboot of the device fixed it. </p>
<p>Note that you need to set this up per vlan. If you want to catch DNS requests for your Guest or IoT vlan, you'll need to do the same. </p>
]]></content:encoded>
      <category>Google</category><category>Linux</category><category>Networking</category>
      <category>debian</category><category>dns</category><category>nextdns</category><category>router</category><category>ubiquiti</category>
    </item>
    
    <item>
      <title>Best DNS tool ever.</title>
      <link>https://yeri.be/best-dns-tool-ever/</link>
      <pubDate>Thu, 17 Oct 2013 19:46:23 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/best-dns-tool-ever/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://web.archive.org/web/20160417172300/http://samarudge.github.io/dnsyo/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Dnsyo&lt;/a&gt;.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><a href="https://web.archive.org/web/20160417172300/http://samarudge.github.io/dnsyo/" target="_blank" rel="noopener noreferrer">Dnsyo</a>.</p>
]]></content:encoded>
      <category>Linux</category><category>Networking</category>
      <category>dns</category>
    </item>
    
    <item>
      <title>Powerdns no answer on A records and others</title>
      <link>https://yeri.be/powerdns-no-answer-on-a-records/</link>
      <pubDate>Fri, 04 Oct 2013 20:10:09 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/powerdns-no-answer-on-a-records/</guid>
      <description>&lt;p&gt;Observed:&lt;/p&gt;&#xA;&lt;pre&gt;mother ~ # dig mother.titify.com&#xA;&#xA;; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.4-rpz2+rl005.12-P1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; mother.titify.com&#xA;;; global options: +cmd&#xA;;; Got answer:&#xA;;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 12227&#xA;;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&#xA;;; WARNING: recursion requested but not available&#xA;&#xA;;; QUESTION SECTION:&#xA;;mother.titify.com. IN A&#xA;&#xA;;; Query time: 1 msec&#xA;;; SERVER: 127.0.0.1#53(127.0.0.1)&#xA;;; WHEN: Sat Sep 28 18:08:19 2013&#xA;;; MSG SIZE rcvd: 35&lt;/pre&gt;&#xA;&lt;p&gt;As you can see, there is a QUESTION section, but no ANSWER. This is an example with a CNAME:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Observed:</p>
<pre>mother ~ # dig mother.titify.com

; &lt;&lt;&gt;&gt; DiG 9.8.4-rpz2+rl005.12-P1 &lt;&lt;&gt;&gt; mother.titify.com
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 12227
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;mother.titify.com. IN A

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Sep 28 18:08:19 2013
;; MSG SIZE rcvd: 35</pre>
<p>As you can see, there is a QUESTION section, but no ANSWER. This is an example with a CNAME:</p>
<pre>airgul ~ $ dig netly.io

; &lt;&lt;&gt;&gt; DiG 9.8.5-P1 &lt;&lt;&gt;&gt; netly.io
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 2513
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;netly.io. IN A

;; ANSWER SECTION:
netly.io. 21600 IN CNAME mother.netly.io.
mother.netly.io. 21600 IN CNAME mother.titify.com.

;; Query time: 277 msec
;; SERVER: 10.60.111.1#53(10.60.111.1)
;; WHEN: Sat Sep 28 20:06:00 CEST 2013
;; MSG SIZE rcvd: 78</pre>
<p>Solution:</p>
<pre>mother # /etc/init.d/pdns stop
mother # /etc/init.d/pdns monitor</pre>
<p>Will probably give an error message such as:</p>
<pre>Sep 28 18:08:02 Should not get here (ns1.titify.com|1): 
please run pdnssec rectify-zone titify.com
Sep 28 18:08:02 Should not get here (ns2.titify.com|1): 
please run pdnssec rectify-zone titify.com
Sep 28 18:08:02 Should not get here (ns1.netly.io|1): 
please run pdnssec rectify-zone titify.com
Sep 28 18:08:02 Should not get here (ns2.netly.io|1): 
please run pdnssec rectify-zone titify.com
Sep 28 18:08:10 Should not get here (mother.titify.com|1): 
please run pdnssec rectify-zone titify.com
Sep 28 18:08:19 Should not get here (mother.titify.com|1): 
please run pdnssec rectify-zone titify.com</pre>
<p>Execute that command:</p>
<pre>pdnssec rectify-zone titify.com</pre>
<p>and it&rsquo;s magically fixed.</p>
]]></content:encoded>
      <category>Errors</category><category>Linux</category><category>Networking</category><category>Software</category>
      <category>dns</category>
    </item>
    
    <item>
      <title>Raspberry Pi &#43; ad blocking &#43; nginx</title>
      <link>https://yeri.be/raspberry-pi-ad-blocking/</link>
      <pubDate>Thu, 19 Sep 2013 20:13:26 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/raspberry-pi-ad-blocking/</guid>
      <description>&lt;p&gt;There&amp;rsquo;s &lt;a href=&#34;http://learn.adafruit.com/raspberry-pi-as-an-ad-blocking-access-point/install-software&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;this howto&lt;/a&gt; that explains how to set up the RPi as ad blocker.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve two RPi&amp;rsquo;s acting a router and was already running dnsmasq. I decided to give it a try. Note that this howto can actually be used on any DNS serving Linux server.&lt;/p&gt;&#xA;&lt;p&gt;First of all, don&amp;rsquo;t go with the pixelserv as it crashes after a few minutes.&lt;/p&gt;&#xA;&lt;p&gt;Apache is an option that worked fine. A general hint: if you&amp;rsquo;re already running Apache or whatever on port 80, just add a 2nd static IP and make Apache listen to that.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>There&rsquo;s <a href="http://learn.adafruit.com/raspberry-pi-as-an-ad-blocking-access-point/install-software" target="_blank" rel="noopener noreferrer">this howto</a> that explains how to set up the RPi as ad blocker.</p>
<p>I&rsquo;ve two RPi&rsquo;s acting a router and was already running dnsmasq. I decided to give it a try. Note that this howto can actually be used on any DNS serving Linux server.</p>
<p>First of all, don&rsquo;t go with the pixelserv as it crashes after a few minutes.</p>
<p>Apache is an option that worked fine. A general hint: if you&rsquo;re already running Apache or whatever on port 80, just add a 2nd static IP and make Apache listen to that.</p>
<p>For example (/etc/network/interfaces) &ndash; be sure it&rsquo;s in the same subnet:</p>
<pre>auto eth0:0
iface eth0:0 inet static
 address 10.100.200.254
 netmask 255.255.255.0
 broadcast 10.100.200.255</pre>
<p>10.100.200.254 is the Apache IP that just serves a HTTP 200 (or 204).</p>
<p>Here&rsquo;s the relevant config part (note the HTTP 204 code, more info on that later):</p>
<pre>&lt;VirtualHost adblock:80&gt;
 ServerAdmin webmaster@domain.net
 DocumentRoot /var/www
 &lt;Directory /&gt;
 Options FollowSymLinks
 AllowOverride All
 &lt;/Directory&gt;
 &lt;Directory /var/www/&gt;
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Order allow,deny
 allow from all
 RewriteEngine on
 RedirectMatch 204 (.*)$
 ErrorDocument 204 " "
 &lt;/Directory&gt;

ErrorLog ${APACHE_LOG_DIR}/error.log
 LogLevel warn
 CustomLog ${APACHE_LOG_DIR}/access.log combined
&lt;/VirtualHost&gt;</pre>
<p>And edit /etc/hosts to add &ldquo;adblock&rdquo;:</p>
<pre>10.100.200.254 adblock.local adblock</pre>
<p>If I had used the IP instead of adblock I would have had this error:</p>
<pre># apache2ctl configtest
[Mon Sep 16 20:27:21 2013] [error] (EAI 2)Name or service not known: 
Failed to resolve server name for 10.100.200.254 (check DNS) 
-- or specify an explicit ServerName
Syntax OK</pre>
<p>With the HTTP 200 code, some browsers expect some content/file in return. So it&rsquo;s generally safer to use HTTP 204 &ldquo;<a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success" target="_blank" rel="noopener noreferrer">No Content</a>&rdquo;; which basically means &ldquo;all good but I have nothing to serve you.&rdquo;</p>
<p>Now, I call myself an nginx fan. Running Apache on a RPi is a no go (at least for me). I could&rsquo;ve ran nginx on the RPi, but decided to run it on a remote server with an additional IP. At least for now. To preserve resources on the RPi.</p>
<p>Here&rsquo;s the relevant config to run it on nginx (and be sure this config is the first file nginx parses; or it might redirect all the domains to some other site):</p>
<pre>server {
 listen 80;
 server_name pixel.0x04.com 10.100.200.254 _;
 access_log /var/log/nginx/pixel.access.log;
 error_log /var/log/nginx/pixel.error.log;
 expires max;
 autoindex off; 
 rewrite ^(.*)$ /;
 location / {
  return 204 'pixel';
 }
}</pre>
<p>And if we test it, this is what we get:</p>
<pre>HTTP/1.1 204 No Content
Server: nginx/1.4.0
Date: Mon, 16 Sep 2013 18:36:52 GMT
Connection: close
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000</pre>
<p>And that&rsquo;s it.</p>
<p>&lt;3 nginx</p>
<p>The only downside is that this won&rsquo;t work with HTTPS. You can run your webbrowser with a self signed certificate, but this will throw errors&hellip;</p>
<p>The result:</p>
<p><a href="https://static.yeri.be/2013/09/adblock.png"><img class="alignnone size-medium wp-image-5298 aligncenter" alt="adblock" src="https://static.yeri.be/2013/09/adblock-300x171.png" width="300" height="171" /></a></p>
]]></content:encoded>
      <category>Linux</category><category>Networking</category><category>Software</category><category>www</category>
      <category>dns</category><category>nginx</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Fuck you, internet.</title>
      <link>https://yeri.be/fuck-you-internet/</link>
      <pubDate>Fri, 15 Mar 2013 15:55:34 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/fuck-you-internet/</guid>
      <description>&lt;p&gt;For a few years I ran my own &lt;a href=&#34;https://yeri.be/public-dns-server&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;public DNS server&lt;/a&gt;. I liked it, great experience, I could easily connect all my host to a central and fast DNS, I avoided all those nasty ISPs who filter their DNS, and it was fast (not Google fast, but fast &amp;ndash; I actually think Google DNS didn&amp;rsquo;t even launch when I set it up).&lt;/p&gt;&#xA;&lt;p&gt;A good year or so, they started using the DNS server to DDoS others (spoofed UDP DNS requests). That&amp;rsquo;s annoying&amp;hellip; It hit like 5k or so requests per minute&amp;hellip; That wasn&amp;rsquo;t really fine, but I didn&amp;rsquo;t care much until I saw the traffic it ended up generating&amp;hellip; Then I started to null route most IPs sending bogus DNS requests (spamming ripe.net or isc.org)&amp;hellip; That usually worked, and for a whole time I didn&amp;rsquo;t get any more DDoS&amp;hellip; Until, apparently, recently.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>For a few years I ran my own <a href="https://yeri.be/public-dns-server" target="_blank" rel="noopener noreferrer">public DNS server</a>. I liked it, great experience, I could easily connect all my host to a central and fast DNS, I avoided all those nasty ISPs who filter their DNS, and it was fast (not Google fast, but fast &ndash; I actually think Google DNS didn&rsquo;t even launch when I set it up).</p>
<p>A good year or so, they started using the DNS server to DDoS others (spoofed UDP DNS requests). That&rsquo;s annoying&hellip; It hit like 5k or so requests per minute&hellip; That wasn&rsquo;t really fine, but I didn&rsquo;t care much until I saw the traffic it ended up generating&hellip; Then I started to null route most IPs sending bogus DNS requests (spamming ripe.net or isc.org)&hellip; That usually worked, and for a whole time I didn&rsquo;t get any more DDoS&hellip; Until, apparently, recently.</p>
<p>And 5 to 10k I can accept&hellip; But 120k is over the limit.</p>
<p>So, as of today I&rsquo;m sunsetting my public DNS. Goodbye and thank you for all the fish.</p>
<p><a href="https://static.yeri.be/2013/03/bind9_rndc.png"><img class="alignnone size-full wp-image-4957 aligncenter" src="https://static.yeri.be/2013/03/bind9_rndc.png" alt="bind9_rndc" width="497" height="388" /></a></p>
<p>I log the queries:</p>
<p><a href="https://static.yeri.be/2013/03/df.png"><img class="alignnone size-large wp-image-4958 aligncenter" src="https://static.yeri.be/2013/03/df.png" alt="df" width="497" height="352" /></a></p>
<pre>vm1 /etc/bind # vnstat -m

eth0 / monthly

month rx | tx | total | avg. rate
 ------------------------+-------------+-------------+---------------
 Apr '12 44.04 GiB | 40.75 GiB | 84.79 GiB | 274.41 kbit/s
 May '12 108.58 GiB | 55.41 GiB | 163.99 GiB | 513.60 kbit/s
 Jun '12 150.30 GiB | 83.51 GiB | 233.81 GiB | 756.69 kbit/s
 Jul '12 240.42 GiB | 958.60 GiB | 1.17 TiB | 3.76 Mbit/s
 Aug '12 197.44 GiB | 745.38 GiB | 942.82 GiB | 2.95 Mbit/s
 Sep '12 182.99 GiB | 627.62 GiB | 810.61 GiB | 2.62 Mbit/s
 Oct '12 135.67 GiB | 431.33 GiB | 567.00 GiB | 1.78 Mbit/s
 Nov '12 93.75 GiB | 592.49 GiB | 686.24 GiB | 2.22 Mbit/s
 Dec '12 118.53 GiB | 68.36 GiB | 186.90 GiB | 585.35 kbit/s
 Jan '13 83.30 GiB | 159.82 GiB | 243.12 GiB | 761.43 kbit/s
 Feb '13 44.15 GiB | 187.99 GiB | 232.13 GiB | 804.93 kbit/s
 Mar '13 51.60 GiB | 532.81 GiB | 584.41 GiB | 4.04 Mbit/s
 ------------------------+-------------+-------------+---------------
 estimated 113.87 GiB | 1.15 TiB | 1.26 TiB |</pre>
]]></content:encoded>
      <category>Linux</category><category>Software</category>
      <category>dns</category>
    </item>
    
    <item>
      <title>Bind mrtg stats</title>
      <link>https://yeri.be/bind-mrtg-stats/</link>
      <pubDate>Sun, 13 Feb 2011 14:53:04 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/bind-mrtg-stats/</guid>
      <description>&lt;p&gt;Because I couldn&amp;rsquo;t find any that worked.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: center;&#34;&gt;&lt;img class=&#34;alignnone size-full wp-image-2551&#34; title=&#34;bind-day&#34; src=&#34;https://static.yeri.be/2011/02/bind-day.png&#34; alt=&#34;&#34; width=&#34;500&#34; height=&#34;135&#34; /&gt;&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: center;&#34;&gt;&lt;em&gt;(Dark blue: incoming queries, light blue: outgoing/recursive lookups)&lt;/em&gt;&lt;/p&gt;&#xA;mrtg.cfg sample:&#xA;&lt;pre style=&#34;background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;&#34;&gt;# Bind&#xA;Title[bind]: Bind Queries&#xA;Target[bind]: `/etc/mrtg/bind-stats.sh`&#xA;PageTop[bind]: &amp;lt;H1&amp;gt; Bind queries per minute on vm1 &amp;lt;/H1&amp;gt;&#xA;Options[bind]: growright,pngdate,nobanner,gauge,nopercent,noinfo&#xA;MaxBytes[bind]: 50000&#xA;Ylegend[bind]: Queries/min&#xA;ShortLegend[bind]:  queries/min&#xA;LegendO[bind]: Incoming Bind queries per minute&#xA;LegendI[bind]: Outcoing Bind queries per minute&#xA;Legend2[bind]: Incoming Bind queries per minute&#xA;Legend1[bind]: Outcoing Bind queries per minute&lt;/pre&gt;&#xA;bind-stats.sh:&#xA;&lt;pre style=&#34;background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;&#34;&gt;#!/bin/bash&#xA;# Bind MRTG stats&#xA;# by Yeri Tiete (Tuinslak) - 10/02/2011&#xA;# https://yeri.be&#xA;#&#xA;# mrtg.cfg sample:&#xA;################################################################################&#xA;#&#x9;#&#xA;#&#x9;# Bind&#xA;#&#x9;#&#xA;#&#x9;Title[bind]: Bind Queries&#xA;#&#x9;Target[bind]: `/etc/mrtg/bind-stats.sh`&#xA;#&#x9;PageTop[bind]: &amp;lt;H1&amp;gt; Bind queries per minute on vm1 &amp;lt;/H1&amp;gt;&#xA;#&#x9;Options[bind]: growright,pngdate,nobanner,gauge,nopercent,noinfo&#xA;#&#x9;MaxBytes[bind]: 50000&#xA;#&#x9;Ylegend[bind]: Queries/min&#xA;#&#x9;ShortLegend[bind]:  queries/min&#xA;#&#x9;LegendO[bind]: Incoming Bind queries per minute&#xA;#&#x9;LegendI[bind]: Outcoing Bind queries per minute&#xA;#&#x9;Legend2[bind]: Incoming Bind queries per minute&#xA;#&#x9;Legend1[bind]: Outcoing Bind queries per minute&#xA;################################################################################&#xA;&lt;h1 id=&#34;file-path-of-namedstats&#34;&gt;file path of named.stats&lt;/h1&gt;&#xA;&lt;p&gt;FILE=/var/log/named.stats&#xA;TMPFILE=/tmp/__dnsstats.txt&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Because I couldn&rsquo;t find any that worked.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-2551" title="bind-day" src="https://static.yeri.be/2011/02/bind-day.png" alt="" width="500" height="135" /></p>
<p style="text-align: center;"><em>(Dark blue: incoming queries, light blue: outgoing/recursive lookups)</em></p>
mrtg.cfg sample:
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;"># Bind
Title[bind]: Bind Queries
Target[bind]: `/etc/mrtg/bind-stats.sh`
PageTop[bind]: &lt;H1&gt; Bind queries per minute on vm1 &lt;/H1&gt;
Options[bind]: growright,pngdate,nobanner,gauge,nopercent,noinfo
MaxBytes[bind]: 50000
Ylegend[bind]: Queries/min
ShortLegend[bind]:  queries/min
LegendO[bind]: Incoming Bind queries per minute
LegendI[bind]: Outcoing Bind queries per minute
Legend2[bind]: Incoming Bind queries per minute
Legend1[bind]: Outcoing Bind queries per minute</pre>
bind-stats.sh:
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;">#!/bin/bash
# Bind MRTG stats
# by Yeri Tiete (Tuinslak) - 10/02/2011
# https://yeri.be
#
# mrtg.cfg sample:
################################################################################
#	#
#	# Bind
#	#
#	Title[bind]: Bind Queries
#	Target[bind]: `/etc/mrtg/bind-stats.sh`
#	PageTop[bind]: &lt;H1&gt; Bind queries per minute on vm1 &lt;/H1&gt;
#	Options[bind]: growright,pngdate,nobanner,gauge,nopercent,noinfo
#	MaxBytes[bind]: 50000
#	Ylegend[bind]: Queries/min
#	ShortLegend[bind]:  queries/min
#	LegendO[bind]: Incoming Bind queries per minute
#	LegendI[bind]: Outcoing Bind queries per minute
#	Legend2[bind]: Incoming Bind queries per minute
#	Legend1[bind]: Outcoing Bind queries per minute
################################################################################
<h1 id="file-path-of-namedstats">file path of named.stats</h1>
<p>FILE=/var/log/named.stats
TMPFILE=/tmp/__dnsstats.txt</p>
<h1 id="how-often-does-mrtg-run-for-me-its-every-10-mins">how often does mrtg run? for me it&rsquo;s every 10 mins</h1>
<p>TIME=10</p>
<h1 id="make-file-empty">make file empty</h1>
<p>echo /dev/null &gt; /var/log/named.stats</p>
<h1 id="generate-file">generate file</h1>
<p>/usr/sbin/rndc stats</p>
<h1 id="save-number-of-queries">save number of queries</h1>
<p>INNOW=<code>egrep &quot;[^I]QUERY&quot; $FILE | awk '{print $1 }'</code>
OUTNOW=<code>grep Outgoing $FILE -A 9 | sed '1,2d' | awk '{ SUM += $1} END { print SUM }'</code></p>
<h1 id="check-if-tmp-file-exists-and-insert-data-in-it-if-it-doesnt">check if tmp file exists and insert data in it if it doesnt</h1>
<h1 id="this-prevents-a-peak">this prevents a peak</h1>
<p>[ ! -e $TMPFILE ] &amp;&amp; echo $INNOW &gt; $TMPFILE &amp;&amp; echo $OUTNOW &gt;&gt; $TMPFILE</p>
<h1 id="get-old-data">get old data</h1>
<p>INOLD=<code>cat $TMPFILE | sed -n 1p</code>
OUTOLD=<code>cat $TMPFILE | sed -n 2p</code></p>
<h1 id="overwrite-old">overwrite old</h1>
<p>echo $INNOW &gt; $TMPFILE
echo $OUTNOW &gt;&gt; $TMPFILE</p>
<h1 id="calculate-to-get-difference">calculate (to get difference)</h1>
<p>INDIFF=$[ $INNOW-$INOLD ]
OUTDIFF=$[ $OUTNOW-$OUTOLD ]</p>
<h1 id="as-mrtg-runs-10--divide-by-10-to-get-per-minute">as mrtg runs */10 &gt; divide by 10 to get per minute</h1>
<p>INPERMIN=$[ $INDIFF/$TIME ]
OUTPERMIN=$[ $OUTDIFF/$TIME ]</p>
<h1 id="print-">print !</h1>
<p>echo $OUTPERMIN
echo $INPERMIN
echo
echo</pre>
Or download the file <a href="https://static.yeri.be/2011/02/bind-stats.sh.txt" target="_blank" rel="noopener noreferrer">riiiiiight here</a>.</p>
<p>Be sure the named.stats file gives this kind of output:</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;"># grep Outgoing /var/log/named.stats -A 9
++ Outgoing Queries ++
[View: default]
               64316 A
                   2 NS
                  22 SOA
                6945 PTR
                 892 MX
                1104 TXT
                3117 AAAA
                  22 SRV</pre>
<p>&hellip; for the outgoing queries, and &hellip;</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;"># grep QUERY /var/log/named.stats | awk '{print $1 }'
163143</pre>
<p>for the incoming queries.</p>
<p>Don&rsquo;t forget to</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;">chmod +x bind-stats.sh</pre>
<p>Live sample: <a href="http://vm1.rootspirit.com/mrtg/bind.html" target="_blank" rel="noopener noreferrer">vm1.rootspirit.com/mrtg/bind.html</a></p>
]]></content:encoded>
      <category>Linux</category><category>Software</category><category>www</category>
      <category>bind</category><category>dns</category><category>mrtg</category>
    </item>
    
    <item>
      <title>Public DNS server</title>
      <link>https://yeri.be/public-dns-server/</link>
      <pubDate>Tue, 16 Feb 2010 17:11:48 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/public-dns-server/</guid>
      <description>&lt;p&gt;I have been running a public DNS server for private purpose (never liked my ISP&amp;rsquo;s DNS servers, and the root servers were usually located too far away (at least those with easy to remember IPs).&lt;/p&gt;&#xA;&lt;p&gt;Anyway, been testing it since this summer, and so far it&amp;rsquo;s been working great.&lt;/p&gt;&#xA;&lt;p&gt;the DNS server running on a Debian &lt;a href=&#34;https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;virtual machine&lt;/a&gt;, hosted by &lt;a href=&#34;http://rootspirit.com&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Rootspirit&lt;/a&gt;, near Amsterdam.&lt;/p&gt;&#xA;&lt;p&gt;IP address: &lt;strong&gt;85.12.6.171&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Hostname: vm1.rootspirit.com&lt;/p&gt;&#xA;&lt;p&gt;Might not be an easy to remember IP address (unlike 4.2.2.1), but as I use that IP pretty much every day, it&amp;rsquo;s okay for me. ;)&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I have been running a public DNS server for private purpose (never liked my ISP&rsquo;s DNS servers, and the root servers were usually located too far away (at least those with easy to remember IPs).</p>
<p>Anyway, been testing it since this summer, and so far it&rsquo;s been working great.</p>
<p>the DNS server running on a Debian <a href="https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/" target="_blank" rel="noopener noreferrer">virtual machine</a>, hosted by <a href="http://rootspirit.com" target="_blank" rel="noopener noreferrer">Rootspirit</a>, near Amsterdam.</p>
<p>IP address: <strong>85.12.6.171</strong></p>
<p>Hostname: vm1.rootspirit.com</p>
<p>Might not be an easy to remember IP address (unlike 4.2.2.1), but as I use that IP pretty much every day, it&rsquo;s okay for me. ;)</p>
<p><em>Edit:</em> Let me remind you that I do not agree with NX domain hijacking, or falsifying/redirecting certain DNS requests (such as OpenDNS google.com to google.navigation.opendns.com or the Belgian ban on stopkinderporno.com and redirecting it to <a href="https://web.archive.org/web/20120117054730/http://84.199.40.99/" target="_blank" rel="noopener noreferrer">84.199.40.99</a>).</p>
<p>Check out <a href="http://code.google.com/p/namebench/" target="_blank" rel="noopener noreferrer">this</a> awesome tool to find the best DNS servers near you.</p>
]]></content:encoded>
      <category>Networking</category>
      <category>dns</category><category>rootspirit</category>
    </item>
    
  </channel>
</rss>
