X

Giving local machines names rather than IP addresses: A follow-up

Giving local machines names rather than IP addresses: A follow-up

CNET staff
2 min read
Regarding yesterday's item on assigning local names to local addresses:

Joseph Bruni adds:

  • You don't have to restart the netinfo domains for changes to take effect. All changes are dynamic.
  • If the machines you create in the machines section are not running OS X, you should remove the 'serves' property. The only two properties you need are name and ip_address.

Cory Tobin describes another method entirely, which "sets the hostname on the Unix end and in NetInfo":

  1. Open Terminal.app.
  2. Type: sudo hostname -s <machinename>.
  3. Edit the file </etc/hostconfig>. You can do this via Terminal, using the pico editior (i.e., type: sudo pico /etc/hostconfig) or by opening up an Aqua text editor, such as TextEdit, with root privileges (e.g., type: sudo open <path for TextEdit.app>
  4. Where the text "HOSTNAME=-AUTOMATIC-" appears, replace "-AUTOMATIC-"
    with whatever name you want (no spaces, of course).
  5. Save changes and quit.
  6. Open up NetInfo Manager.app. Click the lock icon to unlock the app so you can edit settings.
  7. The second window pane will have the things that can be set for /. Click on "machines" and in the third pane click on "localhost."
  8. In the bottom pane, click on the hierarchial arrow to show all items for localhost.
  9. Click on the localhost listed within that. From the Directory menu, select New Value.
  10. Type in the machinename you want and hit return, then drag it so it's above localhost.
  11. Select "Save" from the Domain menu, confirm the update and quit.
  12. On the next restart the machinename will be whatever you set.