I have a Synology 418+ that I use for ISCSI, NFS, SMB sharing primary along as a Backup device. I also leverage some of the Apps within DSM one of which being DNS Server. It’s pretty basic from a setup perspective using the GUI. Awhile back I created two master domains with forward/reverse lookups. One called “local” and the other “localdomain”, I know what you thinking…why? Good question and it was due to default domains names that I never went back and changed. Now I have decided to change what I have so I can leverage what was already built. The following domains had the configuration as:
- local (10.0.1.0) = general computers i.e. desktop, laptop, etc.
- localdomain (10.20.20.0) = lab servers
I decided to do what I should have done long ago and change the domains to something more relevant. I didn’t want to recreate what I had but there is no way I know of to just rename them. So what I did was to export the ones I want to change, edit them and reimport back. Once I know this worked then I would delete the old ones I didn’t want any longer.
Export existing DNS zones
- Login to Synology DSM
- Open DNS Server
- Click on the zone you want to export. For reverse lookup you can edit these int he GUI so you don’t need to export unless you want to in case you have allot.
- Click the above tab “Export Zone”
- This will create a ZIP file called “zonefile”
Edit exported zone
- Go to the directory where you downloaded the ZIP files.
- Using you favorite editor edit the following files and change the old domain to new. In my example I am changing “local” to “home”
$ ls -l total 5720 -rw-r-----@ 1 andy staff 1945 Dec 25 09:31 zonefile.zip $ ls zone.conf zonefile/local $ vi zone.conf # In vi use the example: ":g/local/s//home/g" to make a global change. $ORIGIN local. $TTL 86400 local. IN SOA ns.local. mail.local. ( 21 43200 180 1209600 10800 ) vsphere.local. 86400 A 10.20.20.175 esxivm2.local. 86400 A 10.20.20.177 esxivm1.local. 86400 A 10.20.20.176 centos.local. 86400 A 10.20.20.165 vcenter.local. 86400 A 10.0.1.175 local. NS ns.local. ns.local. A 10.0.1.1 :g/local/s//home/g # This will change it to: $ORIGIN home. $TTL 86400 home. IN SOA ns.home. mail.home. ( 21 43200 180 1209600 10800 ) vsphere.home. 86400 A 10.20.20.175 esxivm2.home. 86400 A 10.20.20.177 esxivm1.home. 86400 A 10.20.20.176 centos.home. 86400 A 10.20.20.165 vcenter.home. 86400 A 10.0.1.175 home. NS ns.home. ns.home. A 10.0.1.1 # Save it and edit the "1.0.10.in-addr.arpa" reverse lookup file in the same way if this was exported. $ vi 1.0.10.in-addr.arpa ... :g/local/s//home/g # Save it and edit the "zone.conf" file in the same way. $ vi zone.conf ... :g/local/s//home/g # Now we need to create a ZIP package $ zip home.zip zone.conf zonefile $ ls -l home.zip -rw-r----- 1 andy staff 1053 Dec 24 12:37 home.zip # Thats all the files , now we will import them back
Importing modified zones
- Go back to your browser for Synology DSM
- Go to you DNS Server App
- Click on Create -> Import Zone
- Since we exported the entire zone we are going to import it as such: “Complete zone settings” and “Browse” for file to import.
- If everything was correct you will get something similar to:
Thats it, easy peasey!