S
S
Stdit2012-02-15 13:29:10
System administration
Stdit, 2012-02-15 13:29:10

OSX $HOSTNAME changing to iphone.mshome.net?

OSX Lion terminal, used for ssh/scp with different servers. Sometimes the hostname changes for no apparent reason:

iphone:~ user$ echo $PS1
\h:\W \u\$
iphone:~ user$ hostname
MacBookAir.local
iphone:~ user$ echo $HOSTNAME
iphone.mshome.net

At the same time, in other tabs of the terminal, on the same machine, the hostname remains the same:
MacBookAir:~ user$ echo $HOSTNAME
MacBookAir.local

How and who can do it? Why only one tab? Why iphone.mshome.net? Perhaps this is due to the change of wi-fi points. I couldn't find the answer on google, please help me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jj_killer, 2012-02-15
@jj_killer

DHCP related. You can hardcode it like this:
sudo scutil --set HostName MacBookAir.local

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question