Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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 Sep 22 '10 at 11:21
See also – Phrogz Apr 11 '13 at 17:06
up vote 4 down vote accepted

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 SuperUser. 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 <putinyourhostname_or_fqdn_here>
like in: sudo scutil --set HostName

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. :)

share|improve this answer

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

In /etc/hostconfig:


(See )

share|improve this answer
This answer is no longer valid for current OS X versions. See the answer here which works at least up to 10.8.3 – Phrogz Apr 11 '13 at 17:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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