Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

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 just came across a strange quirck:

I use my MacBook Pro in the office. Every computer is assigned their IP addresses by a DHCP server. It seems to be the case now, however, that my OS X changed my hostname by itself.

I am assuming this is done because of the fact that my current IP address was previously used by the user with this hostname, but obviously, I don't want OS X to change my hostname without asking me to do so.

How can I prevent this from happening?

share|improve this question
There are some related questions on Server Fault and Super User. You might try sudo scutil --set HostName your-preferred-host-name. – Chris Johnsen Oct 9 '11 at 6:45
FWIW, sudo scutil --set HostName … solves the problem for me, on Lion. – Harald Hanche-Olsen Jul 5 '12 at 12:25
up vote 4 down vote accepted

This issue has been going on for years, and there is no way to "fix" it on the Mac.

What happens is the machine gets an address from DHCP, and then performs a reverse DNS lookup to see if there is a hostname associated with the IP in DNS.

If you are on a Windows network, all of the Windows machines are automatically registered in DNS when they connect to the Domain.

I went on and on with the techs at Apple about this... There is little that you can do at the level of your Mac. It becomes an issue for your network administrator, and since there is nothing really wrong, he/she is likely to leave things as they are.

share|improve this answer

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.