Setting up DNS on Leopard Server

I have had a local DNS server running on my network since I set up my Mac OS X Tiger Server box three years ago. It has served the company well, but of late the old G4 Dual Processor box has started to show its age (a bit like its owner really). Anyway, elsewhere on the network we have a Mac Mini running Leopard Server, and it seemed like a good candidate for a new Primary DNS. It turned out to be quite straightforward, but irritatingly and Apple-ish-ly different from what you might expect, so I thought I should document how to get it right first time (if only so I can remember for myself in future!).

To begin with, your Leopard Server needs to be running in Advanced mode, so that you get the Server Admin UI rather than the more limited Server Preferences window that you see in a simple Leopard Server setup. If you have the simple setup, don't worry - you can convert it as a one-off to an Advanced Server setup. Simply find the Server Admin Tools disk from your Leopard Server installation kit and start the Tools installation. A window will pop up asking you whether you want to convert your server. If you OK this it will take just a few seconds. It didn't seem to have any adverse effect on my server, though, as ever, YMMV.

Now you should have the Server Admin program in /Applications/Server (I'd advise dragging the icon to the Dock - do the same for the Workgroup Admin icon while you're at it - you won't use it for this tutorial but you'll doubtless need to look at it sometime). Start it up and you'll see something like this:

 

Server Admin UI

 

This shows a list of the services that you have configured, and the ones that are running are "lit up" in green. In the screenshot above the DNS service is shown as running, though it won't be when you first start up Server Admin (yes, I'm lazy and didn't do before and after screenshots).

Select the DNS option and you will see the panel for creating zones and machines. The main control you need to use here is the toolbar, and the main button is the Zones button.

 

DNS toolbar

 

Choose Zones now and you will see the user interface for setting up your DNS service. Without going into geeky detail, your DNS server will probably have just one zone, which corresponds to the domain that you are using. In your zone you need to define the names and ip addresses of the machines you are going to use. In my case I use example.com for my internal network, and my addresses all come from the 10.10.10.x address range.

So, to start, find the "Add Record" dropdown in the middle of the screen and choose "Primary Zone (Master)". You would choose Secondary if you were running more than one DNS server - the secondary server would pick up its data from the primary. I don't need more than one DNS server.

 

DNS toolbar

 

If it is not filled in by default, put the domain name you want to use (in this case example.com.). Notice that the domain name has a dot at the end of it. This is really important for setting up DNS, as it confirms a fully qualified domain name (you'll notice that the tick box activates when the domain name ends in a dot). You also need to put in the name of your DNS server here (this is the server you are currently setting up - mine is called holmes). Here is how mine looked once I had completed the details. Note that the nameserver appears as "holmes.example.com." I only had to put in the "holmes" bit of that - Server Admin added the rest to make it fully qualified.

 

 

 

Also notice that I didn't complete any Mail Exchanger information or tick the Allows zone transfer box (because I don't know what these do). Nor did I add an Admin Email address. The crucial things on this screen are to add a fully qualified domain as the Primary Zone Name and the name of your Nameserver.

The next thing to do (after pressing the Save button) is to add records for your machines to the zone. The obvious first machine to add is the nameserver itself (holmes in my case). Choose the Add Record dropdown and Add Machine (A).

 

Adding a machine

 

Then add the name of the machine and its ip address (in my case, holmes and 10.10.10.5 respectively), plus any other information that you might want to include. Then I added the remaining machines and finally clicked on the Save button. Here is how the user interface looked after adding all of the machines I needed for my network.

 

DNS setup complete

Take a close look at the screenshot above. The bottom half shows the details for the machine selected in the top half. In this case it is a MacBook Pro whose name is rebus (have you noticed a theme in my machine names yet?).

 

In the top half of the screen you will see the zone name (example.com) with the machine names indented below it. Above it you will see the rather weird title 10.10.10.in-addr.arpa, with another list of your machines as fully qualified domain names and their ip addresses. This list is added for free as you set up each machine, so you don't have to worry about how to add these records.

Once you have done all of the above, you simply make sure you have saved everything and then click on the Start DNS button. This will start the service and you have a working DNS.

To set up one of your machines to use the new DNS server, open up the System Preferences on that machine and go to the Network pane. Set the DNS Server and Search Domains entries to match your new DNS server.

 

 

To test, open up a terminal on your client machine (after you have applied these settings) and ping one of the other machines on your network. You should see something like this:

Pinging your new DNS server from a client

That's it - you're done.

One more thing. You may be interested to know something about how this DNS configuration stuff is actually stored on your server. I'll be writing about that shortly.