I have a Mac Mini Server (named Server) with the following DNS setup

Primary Zone: example.com
   mysql-host.example.com machine (
   server.example.com machine (
   server.example.com nameserver (
   www.example.com machine (

www.example.com is a linux box with Apache. How do I get both example.com and www.example.com to work. Right now, I can view my website with www.example.com only. I know there's nothing that points example.com to the IP, but when I create a machine record without a hostname I get an error (This machine record cannot be created without a host name.).

  • An A record for domain.com would suffice. Have you tried a "." for the hostname? – Nathan C May 30 '14 at 17:11
  • Um, did you try entering domain.com? – Michael Hampton May 30 '14 at 17:14
  • I can't enter domain.com, I get that error: This machine record cannot be created without a host name @MichaelHampton – ggstevens May 30 '14 at 18:06
  • @NathanC I can't enter a "." either. – ggstevens May 30 '14 at 18:07
  • 1
    I was able to use example.com by editing the config file manually instead of using the GUI. – ggstevens May 31 '14 at 2:46

You should be able to do this in the regular Server application interface, simply by entering the full domain name (e.g. "example.com") in the Host Name field. There are a few notes, though:

  • Make sure the interface is in "Show All Records" mode (selectable from the "action" (gear icon) pop-up menu under the DNS Record list. Without this, it hides (and doesn't let you control) critical details, like the zones themselves.
  • When creating the Machine Record, it normally suffixes the "Host Name" field with the zone name (e.g. Host Name="www" in zone "example.com" will create a record for "www.example.com"). But this is not done if the Host Name is the zone name (and you can see this at the top of the window). For example, if the zone is "example.com", and you type "example.co" in the field, it'll show "example.co.example.com" at the top of the window -- but as soon as you add the last "m", it changes to just "example.com".
  • Do not try to use a "." to terminate the Host Name (as the standard FQDN syntax requires), leave the field blank, or use "@" (bind zone file shorthand) -- the server interface will reject all of these. Note that it will be converted to standard FQDN format when it's written into the zone file.

As you apparently discovered, you can also do it by editing the zone file directly. But of course I have some notes about that as well:

  • The zone files are in a nonstandard location: /Library/Server/named/ (with named.conf right alongside them).
  • Be sure to copy the format of the entries Server.app creates exactly. I haven't experimented much with Server v3.x, but with an earlier versions I once had the admin interface get confused because I didn't use the expected number of spaces between fields.

what are you using for your DNS? Bind does weird things with apex domains.. but like the other comments say, you could probably just specifiy

example.com. A

i assume if you then did a

dig axfr example.com

you would no longer see an SOA returned.. i dont know what implications this would have for your other records.

I believe this will also help you: https://stackoverflow.com/questions/16022324/how-to-setup-dns-for-an-apex-domain-no-www-pointing-to-a-heroku-app

  • I'm using Apple OS X Server 3.1.1 (Mavericks). – ggstevens May 30 '14 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.