Hostname on OS X

Posted by rue, Sun Mar 02 05:34:00 UTC 2008

Looks like this may change in the future, but for now setting your hostname on Leopard is easiest with these two steps:

  1. `sudo vim /etc/hostconfig`
    1. Add @HOSTNAME=”machine.domain.tld” somewhere
  2. `sudo hostname machine.domain.tld` sets it for the current session so you do not need to restart etc.

The System Preferences > Sharing and Network have some options but I got tired of twiddling with them.

Filed Under: mac | Tags:

Comments

  1. Steven Parkes 04.08.08 / 06AM

    I think you’re looking for sclist with the HostName parameter. Took me a while to find when I first got my mbp.

Have your say

A name is required. You may use HTML in your comments.