As a follow up to a question I've asked earlier: Linux server migration to Windows workstation. A supplier got us a new network-card yesterday, but no harddrives so far. I've also bit the bullet on reconfiguring the server as there was too much behavior on the old machine I couldn't explain/fix and the previous developers left without documenting anything. It'd also be good to upgrade from Ubuntu 14 to 20. Most work went smooth, only bind/dhcp have me scratching my head for the better part of the past 24 hours.
Goal
Set up bind9/DHCP and Shorewall and take a working config back home on a pendrive. Finalize everything there and test it before actually replacing the old machine.
VM Setup
I have VirtualBox6 running in my host; and have added two network adapters to it. The VDI is dynamically resizable for now to make the most of the small SSD we have available.
Both adapters are attached to Bridged Adapter with default settings. I only picked the correct port for the two adapters in the VirtualBox dropdown 'Name:'
In my Guest
The Guest OS (Ubuntu 20.04 LTS) sees both network interfaces and when using ifconfig I can see two separate interface names for them (for simplicity):'A1' and 'A2'.
A1 is connected to a Modem and gets an IP. I can browse the internet when this is attached.
A2 should go to a switch, letting other devices connected to that switch use the intranet that should be on there. A1 uses the DHCP as given by a modem. I set A2 manually to 10.0.0.1 and 255.255.255.0 mask. I left the other fields blank.
Guest installations
On my guest I've added ShoreWall (https://shorewall.org/), ISC (https://www.isc.org/dhcp/), Bind9(https://www.isc.org/bind/) and other applications. The three mentioned here are the last ones I'm having trouble with.
Guest configurations
I copied over the config-files of the old machine to the new machine and replaced the freshly installed ones where needed after comparing them. When moving through versions I double checked the docs of the tool (Only Shorewall saw a version increment).
I started with Shorewall, where I used the new interfaces (A1 and A2) to replace the old interface names in the shorewall configuration files (host, interfaces, masq). After updating all the configuration files I got the firewall started with:
sudo shorewall check
which converted the masq to snat file (version upgrade)
Next I started the firewall sudo shorewall start
and checked the status sudo shorewall status
. On every reboot of the VM Shorewall starts and the status tool does not report any issues.
Next I focused on bind9. There was no major version upgrade going from the old to the new server. As before I compared and copied the old files to /etc/bind/ adding them as needed. Rights, and chmods were checked and compared to the old server. One of the files is called intranet.sitename.org - it is supposed to get all calls going to it and point it to itself - there's also an Apacheserver on this server which can be accessed using the localhost/127.0.0.1 and 10.0.0.1.
After moving all config files I ran these commands:
sudo rndc reconfig
sudo rndc reload
sudo named-checkconf
sudo systemctl restart bind9
All commands passed without errors.
I then used nslookup
to test my dns.
nslookup ubuntu.com
worked and gave the result as described here (https://serverspace.io/support/help/configure-bind9-dns-server-on-ubuntu/)
When using the intranet url however I got an NXDOMAIN error:
nslookup intranet.sitename.de
The full reply was:
** server can't find intranet.sitemane.de: NXDOMAIN
I emptied the cache, went over the configuration files again, but I can't find the issue. The issue might be related to the 'Server' that's reported by nslookup. When comparing it to the original machine, the value for 'Server' is 10.0.0.1, whereas on my new machine it report 127.0.0.1. There is however a db.10 file in /etc/bind which was copied from the old server and has correct access rights on it.
Questions
- Am I correct to use bridged adapters in Virtualbox? If not, how do I make sure that A1 and A2 are mapped to the correct physical wires coming out of the server?
- Is there another place where bind stores configuration files? I've found /etc/default on the web, but I have no files there for now.
- The old server does not have an IPV6 address, could this be related to the issue I'm having?
- How do I fix the NXDOMAIN for intranet sites error.
Any help and pointers are highly appreciated.
Best regards.