I want to force OS X 10.6 to use the hostname that I assign it but still be able to use DHCP.

The old method of editinng /etc/hostconfig is not good anymore, the file containing "This file is going ways" message at the top.

How to do this?

link|improve this question

79% accept rate
Why is DHCP issuing a hostname? If no good reason, switch it off at DHCP level. – dunxd Sep 22 '10 at 11:18
LOL, I suppose you are working in a micro-environment :) – Sorin Sbarnea Sep 22 '10 at 11:21
feedback

2 Answers

up vote 2 down vote accepted

Not sure if it still works on Snow Leopard, but this used to work on Tiger at least:

In /etc/hostconfig:

#HOSTNAME=-AUTOMATIC-
HOSTNAME=your.host.name

(See http://www.geektimes.com/macintosh/os/x/10_0/core/hostname.html )

link|improve this answer
feedback

I ran into this problem too, at my wife's school, where they have a DHCP server. She's running 10.6.6 Snow Leopard. Everytime I'd open Terminal on this network, the hostname would be set to something else.

I found a solution posted by user "Wolf" on the site superuser.com. Here's the URL: http://goo.gl/6son2

If for some reason, the post is gone, here's what Wolf mentioned, that worked for me:

======================

Set it in the Terminal with

sudo scutil --set HostName

like in: sudo scutil --set HostName server1.mynetwork.com

======================

Worked like a charm. I'm hoping when my wife takes her laptop home and returns on Monday I won't have to re-run this command. :)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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