OSX $HOSTNAME is changed to iphone.mshome.net

Terminal OSX Lion used for ssh/scp to different servers. Sometimes I for no reason changed:
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 I remains the same:
MacBookAir:~ user$ echo $HOSTNAME
MacBookAir.local

How and who can do it? Why only one tab? Why iphone.mshome.net? Probably, it is connected with the change of wi-fi hotspots. Google found no answer, help me understand.
October 8th 19 at 03:30
1 answer
October 8th 19 at 03:32
Related to DHCP. Hard to register, you can:
sudo scutil --set HostName MacBookAir.local

Find more questions by tags TerminalHostingmacOSSystem administration