Updated PADD for display when Unbound has updated the root name servers

Et cetera
3 min readFeb 6, 2021

--

In the research of show more useful stats/infos on the display of my Raspberry PI I found another useful data: when Unbound has updated the root.hints file with the 13 root name servers in order to get the authoritative name servers. A you can see from the image I added under the Unboun section the “Updated: January 11, 2021

But I run in some trouble for a quite silly reason: if you have installed Unbound via a package manager, it has downloaded and installed the root.hints, and updated, by default in /usr/share/dns/. But for some unknown reason, the file is been updating only in the latest section, not in the firs section where it contains the date of the update.

You can check by write

cat /usr/share/dns/root.hints

And it should reports in the first lines a date:

last update: March 13, 2019

But the official root servers (available here www.internic.net/domain/named.root ) has been updated on a different date (last update: January 11, 2021). The other text/lines inside the file should be the same and you can check it manually or using

diff /usr/share/dns/root.hints <(curl https://www.internic.net/domain/named.root)

It should reports only the differences inside the file:

But anyway the default file has a very old date, so we need to download the original file and place it in the default Unbound location when you install it without a package manager, that is in /var/lib/unbound/

So write this command to get the root.hints and place it in the correct directory

wget https://www.internic.net/domain/named.root -qO- | sudo tee /var/lib/unbound/root.hints

Then we need to say to Unbound to use the new file location (that is already inside /etc/unbound/unbound.conf.d/pi-hole.conf but is commented)

# Use this only when you downloaded the list of primary root servers!
# If you use the default dns-root-data package, unbound will find it automatically
root-hints: “/var/lib/unbound/root.hints”

And this is done, now you need the new version of my padd modified script in order to show the date, grab it from here (it’s in very alpha stage with a lot of unnecessary comments, if you want to clean the code): https://gist.github.com/giuliomagnifico/d09a12593f0f3695d4b5b2b43eb6ff6f

But you also will need to update/get/check when the new root.hints file has been updated, to do this, I added a cron command that grab and install the root.hints file every 1 day of every month at 1:00 AM (but you can change it, like every 2 or 3 months, because the file is not update this often)

#Unbound root-hints update00 01 01 */1 * wget https://www.internic.net/domain/named.root -qO- | sudo tee /var/lib/unbound/root.hints

I hope this help, is pretty simple but I think is usefuel to give a glance to PADD and detect if, sometimes, the root.hints file has been updated. Because I always forget to do it manually.

I’m working on PADD in order to display some more infos and stats of Unbound, but at the moment that’s all =)

--

--