Changing Your Lion Server's Hostname

Changing Your Lion Server's Hostname
Courtesy of Coyote Moon, Inc.

Installing OS X Lion Server is pretty easy, that’s because it is installed on your already working copy of OS X Lion. There are a few additional steps, one of them being server's hostname. Since the server installation process is pretty much automated, you won't see an option to set the hostname. Instead, Lion Server will use the computer name and hostname that were in use on your Mac before you installed Lion Server.

That may be fine, but chances are you'll want a name for your home or small business network server other than Tom's Mac or The Cat's Meow. You'll use the server's hostname to access the various services you set up. Cute names are fun, but for a server, computer and hostnames that are short and easy to remember are a better choice,

The hostname of your OS X Lion Server is something you should set up before you go too far with configuring and using various services. Making changes later, while possible, is likely to affect some of the services you're running, forcing you to shut them down, and then restart them or even reconfigure them.

This guide will take you through the process of changing your server's hostname. You can use this guide now to change the hostname before you set up all of the services, or use it later if you decide you need to change your Mac's server name.

Change the Computer Name

  1. Launch the Server app, located at /Applications.
  2. In the Server app window, select your server from the list pane. You'll find your server in the Hardware section of the list, usually near the bottom.
  3. In the right-hand pane of the Server app window, click the Network tab.
  4. In the Names area of the window, click the Edit button next to Computer Name.
  5. In the sheet that drops down, enter a new name for the computer.
  6. In the same sheet, enter the same name for the Local Hostname, with the following caveats. The Local Hostname should have no spaces in the name. If you used a space in the Computer Name, you can either replace the space with a dash or delete the space and run the words together. You may see the Local Hostname listed in other locations on your Mac ending in .local. Do not add this extension; your Mac will do that for you.
  7. Click OK.

Although you entered a hostname in the above step, it was only the Local Hostname used by the non-server part of OS X Lion. You will still need to follow the hostname change instructions below for your Lion Server.

Change the Host Name

  1. Make sure Server app is still running and still displaying the Network tab, as outlined in the "Change the Computer Name" section, above.
  2. Click the Edit button next to Hostname.
  3. A sheet labeled Change Hostname will drop down. This is an assistant that will take you through the process of changing the server's hostname.
  4. Click Continue.

Setting Up Hostnames

You can set up hostnames using one of three methods. The process is similar for each, but the end result is not. The three setup options are:

  1. Local network: This option lets you use just about any name you wish for the hostname, however, only computers and devices on your local network can access the server by using the hostname you create. You will not be able to use the local hostname remotely, either from an Internet connection or from a virtual private network (VPN) connection. This is the most common setup for a home or small business network that doesn't wish to expose its network to the public.
  2. Private network: This option is similar to the local network option. The difference is that the hostname will be usable from a remote VPN connection. This option is a good choice when you have a remote office that needs to connect to your local network, but you still don't want your network to be accessible from the Internet.
  3. Internet host name: This option configures the hostname to be a fully qualified domain name that can be accessed from the Internet (if you allow it via firewall rules). In order to use this option, you must first have a registered domain name to use for the hostname.

Make your selection and click Continue.

Entering Your Hostname

Enter the computer name. If you already did this in the earlier step, your selected computer name will already be entered. You will see three different requirements for the name you enter into the Hostname field. Match the requirement to the type of hostname you created, above.

  • Local network: When entering a hostname in this field, make sure that the name ends in .local. Also, the hostname must be all lower case letters and not contain any spaces.
  • Private network: When entering a hostname in this field, the name must end in .private and must include both a domain name and a hostname. An example would be server.example.private, where "server" is the hostname, "example" is the domain name (also called a subdomain), and "private" is the top-level domain. Once again, all lowercase letters and no spaces in the hostname.
  • Internet host name: If you're entering a hostname in this field, it must be a fully qualified domain name that you have registered with a domain authority. For example,, where "server" is the hostname and can be any name you wish to use; "example" is the domain name you registered; and "com" is the top-level domain that you registered. Once again, the hostname must be all lowercase letters and not contain any spaces.

Enter the hostname in the appropriate field and click Continue.

The assistant will make the necessary changes and propagate them to your server and its various services. To ensure that the changes get picked up, you may want to stop all running services and then start them back up.