Making Apple's DNS GUI on Mac OS X Server play nice with the Unix way of things

The DNS implementation in MacOS X Server (10.6 Snow Leopard, and likely earlier versions going back to 10.3 Panther) is unique to Apple and unfamiliar and unfriendly to Unix geeks. Some say that you cannot use both Apple's GUI and traditional text based zone files, that you must either go all GUI or bypass it altogether.

This is incorrect, and it is actually quite easy to make both work. Here are the files Apple provides (note that "/etc/" = "/private/etc/"):
If you inspect those files, you will see that Apple asks you not to hand edit them, as the files are computer generated. They mean it. Hand editing will either break BIND or more likely simply be overwritten by the Server Admin program.

However, as in all Unix systems, all DNS configurations start with
Open that file and observe that it ends with:
// Public view read by Server Admin

include "/etc/dns/";

// Server Admin declares all zones in a view. BIND therefore dictates
 // that all other zone declarations must be contained in views.
Views are the key to what Apple has done. Views allows different zone files to be served up depending on from whence a request comes. This makes it easier to have private internal domains and public domains served by the same named instance.

So here's what to do. Add a line similar to this at the end of named.conf:
include "/Users/jwb/Documents/serverconfs/bind_jwb.conf";
Then, create a file similar to this at the above location, with appropriate read permissions:
view "jwb" {
	match-clients {any;};
	recursion no;
// put zone descriptors here

zone "" in{
  type master;
  file "/Users/jwb/Documents/serverconfs/zones/";
  // enable slaves only
  allow-transfer {;;};
Make sure you place a correctly configured zone file at the referenced location.

Check your configuration with
alias dnsok 'sudo named-checkconf -z;'   // add to aliases.mine
Assuming all is well, go into Server Admin and Stop/Start DNS. You should now be in a position to manage some zones with Apple's GUI, and others with text-based zone files as you have always done.

If something is not working, check your zone configurations, permissions, balanced brackets, and file references/locations. Enjoy!

 © 1997-2022 Jeffrey W Baumann dba LinkedResources. All Rights Reserved. Last Updated December 28, 2021.