0

I have an Imac with Yosemite installed with all latest updates. It uses a static IP.

When I open up a Terminal window it appears like this:

IMac\203975092370517331:~ peter$

This is very strange.

When I type in echo $PS1 I get as an result: \h:\W \u\$

So it should display my hostname, working directory and username.
My hostname then should be IMac\203975092370517331

but If i check in the system settings -> Sharing -> Computername there I only have IMac. Also under the Network Settings with my static IP connection in WINS I also got IMac in there.

So my Hostname should be Imac and not Imac\203975092370517331

I don't understand this behaviour? why is it like that.

What can I do against it?

I also checked with the tool Wireshark the network Traffic and from there I can see that my Mac is in the local network as IMac with that wired number.

I really don't understand it

Anybody any clue what s going on?

0

The terminal is reverse-mapping your IP address to get the hostname, not taking it from system settings. The DNS server you are using has old / bad PTR records for the IP address your system currently has. Feel free to hard-code your correct hostname in the PS1 variable, that's what I do as I travel a lot and used to see this a lot (and was simlarly annoyed). It's an old vestige from the BSD TCP/IP stack that's still there in OS X.

0

\2039 is the ISO code for ‹ (single left-pointing angle quotation mark) so could there somehow be some weird unprintable characters in there? Maybe try changing the name to IMAC2 and click the Edit button there and change the .local version of the name as well. Does the \2039... go away? Then change both back to IMAC.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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