Monday, March 5, 2012

Hostname on Mac OS X

If the dynamic hostname is provided by DHCP, and you prefer a fixed one, there are a few ways to do it.

From System Preferences/Network

  • Select the network adapter which interfaces the DHCP server.
  • Click on the "Advanced" button on the lower right.
  • In the TCP/IP tab, specify the "DHCP client ID" text field.
Or depending on the version of Mac OS:

-- Mac OS X 10.5 and older
On Mac, the hostname shown on the terminal prompt is configured by the file,
/etc/hostconfig. If it is specified as
HOSTNAME=-AUTOMATIC-,
the name shown in the prompt is provided by DHCP or BootP server.

Change that line to
HOSTNAME=(preferred-name)

-- Mac OS X 10.6 and newer
Use the command scutil (system configuration utility)
scutil --set HostName (preferred-name)

Remember to check the name set in
/Library/Preferences/SystemConfiguration/preferences.plist,
under System/System/ComputerName

No comments:

Post a Comment