The default DNS server implementation of bind9 in the Diskstation platform works well.
The management interface does quite a good job and is vastly better than manually editing the config files for the bind9 process.
Using the DNS service to manage your local network is often a good idea, it gives a higher level of control of the network and, in conjunction with the DHCP server, can make management easier especially if hosting services which are accessed from both the internal networks and from the internet.
However, you may notice warnings in the DNS log, with messages such as:
checkhints: b.root-servers.net/A 17 (xxx.xxx.xx.xx) extra record in hints
and/or
checkhints: b.root-servers.net/A 17 (xxx.xxx.xx.xx) missing from hints
and there may be associated requests to an old b.root-server.
These warnings occur because the bind9 package supplied with Diskstation has a long outdated root server list. On my DS723+ the db.root file was last updated in 2010 !! Note, that this date is taken from the 'Last update' comment in the file itself, not the file date shown by the Linux file system.
The fix for the problem is quite simple and requires admin access to the server via SSH (There is a more convoluted way to perform the update without SSH which I will present later in this document.)
- First, open a SSH session to the server using your favourite terminal emulator, eg. PuTTY or a Linux terminal
ssh -p <port> <user>@<ip-addr> (supply the port if you changed it from the default, user, and server address from your diskstation) - Enter the password to login
- Change to the directory where the db.root file is located
cd /<volume>/@appstore/DNSServer/named/etd/default (use the appropriate volume name from your system) - Find the last update date of the file
grep update db.root - This displays the date when the file was last updated
If the file is too outdated then the DNS system will probably throw warnings as described above.
To update the file requires a simple command to pull the latest file from the internic servers.
sudo wget -Odb.root https://www.internic.net/domain/named.root (Note the need for sudo which allows the file to be overwritten, if you are running as root then you can omit the sudo command)
After entering your password for the sudo command, the wget command executes and the db.root file should now be the latest version, which you can check using the grep statement shown previously.
To use the new file it is necessary to restart the DNS server or reboot the Diskstation, after which you will notice no more warnings from requests to the b.root-servers.
What if you don't have SSH access to the server?
There is a way to accomplish this update using the built-in tools on your Diskstation.
Via the DSM web interface:
From the File Manager app, create a new file in the home directory of your administrator user called dns-update.sh
open the Control Panel and select Task Scheduler
Select: Create -> Scheduled Task -> User-defined script
- Enter a suitable name eg. DNS Root Server Update
- Change the user to 'root'
- Uncheck the 'Enabled' flag
Change to the Task Settings tab and in the User-defined script box, paste the following as a single line.
/usr/bin/wget -O/volume1/@appstore/DNSServer/named/etc/default/db.root https://www.internic.net/domain/named.root (The text will wrap in the box, there is no need to reformat)
Save the new task.
To see the output of the task after it is run, you will need to specify a folder to store the output.
Select the 'Settings' button on the main Task Scheduler screen, check the 'Save output results' flag, and specify a folder to save the output.
Save the setting and execute the command via the 'Run' button.
The advantage of this method is that you can update the db.root file on a regular basis with a simple process, though the master file does not change very often.