For a new project I started last week I needed a DNS server in my home office. Usually, my router is my dns resolver, but it doesn’t allow to create authoritative zones. Windows 10 running on my laptop doesn’t have a DNS server either, and I don’t have an hypervisor in my home office to build a virtual machine; and it wouldn’t even be useful to spend so much time doing it for then using the DNS just a couple of hours.
So, I looked around and I found this tiny cool project called MaraDNS, that was perfect for my use case.
My local DNS server
MaraDNS does just this: it allows you to run on the fly a DNS server that can host authoritative zones. However, the developers removed this option from the latest versions, and the last version that can act as an authoritative DNS server is here:
After unpacking the zip file, I edited the file mararc so that its content it’s like this:
ipv4_bind_addresses = "172.27.217.93" timestamp_type = 2 random_seed_file = "secret.txt" csv2 = {} csv2["virtualtothecore.local."] = "db.virtualtothecore.local.txt"
172.27.217.93 is the IP address of my laptop, and the last two lines means 1-we want to run an authoritative zone, and 2-the zone name is virtualtothecore.local and its resource records are stored in that text file. Also note that the zone ends with a trailing dot; this is how officially the DNS system works, even if years of using browsers that add it but don’t show it, has made people forget about it.
Then, I created a new text file named db.virtualtothecore.local.txt, with this content:
virtualtothecore.local. 172.27.217.93 ~ vcsa.virtualtothecore.local. 172.27.217.30 ~ esx1.virtualtothecore.local. 172.27.217.151 ~
Here, I’ve registered all my new machines I needed to manage.
Ok, it’s all set. Time to start the service. In the folder there’s a bat file called run_maradns.bat, I double click on it to start the software:
The DNS server is running, and you may also get another confirmation by the fact that Windows Firewall will ask you to allow the service to communicate on your private network.
Then, I configured also my own laptop to use the new local DNS server, and I tested if the zone works correctly:
Yup, the zone is served correctly from my laptop.
Now, I can use the new dns in my project, and just stop the program when I don’t need it anymore.
By now you may have understood what I was doing. I was spinning up a new vCenter appliance in my new NUC server, that had disks ready to be used for a single-node VSAN cluster. This means that I had no existing datastore, so I could only spin up the vcsa using a dedicated option to build the vsan datastore at the same time. I could not deploy a DNS server VM on the NUC before I had VCSA up and running, but I was stuck at the beginning of VCSA deployment at its Stage 2 (with the message “starting vmware appliance configuration” and no progress at all) because of the lack of DNS to resolve vcsa itself and the underlying ESXi server.
A ugly Chicken&Egg situation, solved brilliantly thanks to MaraDNS: