One super easy way to solve this problem is to use a virtual machine. A virtual machine, or VM for short, is basically a virtual computer that will run alongside Mac OS X. You would install Linux on the VM and then serve the DNS server from Linux, which is trivial.
- It's quick and easy to set up. (Installing Ubuntu takes less than 15 minutes on a modern Mac.)
- VMs give you a lot of flexibility. For example, if you need any additional services in the future, its probably going to be easier to just add them to your Linux VM than it is to mess with trying to installing it on OS X.
- Some would consider this to be a clunky solution. It stands to reason that one should not have to resort to switching operating systems in order to get something as simple as a DNS server. This is mitigated by the fact that we don't have to switch away from OS X - we can just run Linux and OS X side by side.
- It takes more system resources to host an entire computer that it does to simply have OS X running a DNS server. This is mitigated by the fact that it doesn't take all that much resources to host a Linux VM, and we can restrict the VM from consuming more resources than it needs to function.
Convinced and ready to start? Here's a quick start guide.
1) Download and install VirtualBox, which is free software that allows you to create and run virtual machines on OS X.
2) Download the ISO file for Ubuntu Server, which is the most popular version of Linux.
3) Start up VirtualBox. Create a new VM. Feel free to leave all the default settings if you want, or customize away - it doesn't really matter. However, one important thing is to change the networking mode from the default (which is NAT) and set it to bridged. This will give your VM an IP address on your local network.
4) Power on the new VM. VirtualBox should prompt you for the location of an ISO file to be "inserted" into the virtual CD-ROM drive, so choose the Ubuntu Server ISO that you just downloaded.
5) Now, just follow the prompts to install Ubuntu. It's pretty easy and much like installing OS X or Windows - you just keep hitting next.
6) Once it is finished, you can log on and are greeted with the (hopefully familiar) Linux command prompt. The first thing you will probably want to do is to download all the security and bug fixes:
sudo apt-get update && sudo apt-get upgrade -y
7) Install BIND, which is the most popular DNS server for Ubuntu:
sudo apt-get install bind9 -y
8) Edit the main BIND configuration file to your liking:
sudo nano /etc/bind/named.conf
nano is a text-editor program)
9) Start the server by doing a
sudo service bind9 start
10) Find out the IP address of your VM by doing a:
11) Now that you know the IP address, you can set that to be your DNS server on OS X. And you're finished!
For more information on the stuff in the config file, or to find out stuff like how to make BIND automatically start when you turn on the virtual computer, check out the official Ubuntu BIND documentation. If you find that too dry, there are also plenty of over tutorials on Google that might be a little more user friendly.