I see nothing useful.
I suspect it's a cache issue.
After a boot into the safe mode and then back to normal, the terminal prompt now reads
so, to me, it's a cache problem - but which one?
My original question is simple - from where does the terminal get the computer name?
Message was edited by: nerowolfe
From the same place the hostname command gets the host.
man 1 hostname
man 7 hostname
man 3 gethostname
Generally speaking this comes from the IP address (DHCP assigned IP address maybe), and then a reverse DNS lookup of the IP address to what the DNS server/DNS cache thinks is the name associated with that IP address.
You could try flushing your DNS cache, but that will not stop the DNS server from providing the same values again:
dscacheutil -flushcache # Leopard
lookupd -flushcache # Tiger
My work hostname looks like:
I personally do not like this, so I changed my .bashrc so that it explicitly sets my PS1 variable to a name string I desire.
Because I use the same .bashrc file on several systems, I make some tests to see which Mac, Linux, Solaris, AIX system I am currently on. It is a bit complex, but it works for me, and avoids using the dhcp-location-x123-abcd-xx-xxx-xxx-xxx name.
I did some further digging after the terminal name became "new-host-2" and I think it's my router doing the dirty
The router shows two computers for this box, the correct name and the new-host name.
Not so curiously, in Sharing Preferences, under File Sharing, the text says that my computer is available at both locations as below:
Other users can access shared folders on this computer, and administrators all volumes, at afp://new-host-2.home/ or "nerombp17".
I suspect that my router is being confused when I switch from Ethernet to WiFi, but at this point I am not sure, but it does seem that way when I browse my router GUI.
I only noticed this because it's unusual and new and those things are triggers for me.
This is the only computer that uses both Ethernet and WiFi and it's possible that they can both be on at the same time - I am not sure.
I don't know if the router is the cause or the result but I suspect the former.
I don't have any Windows boxes on at this time, and my other MBP which is connected via WiFi does not show any problems, and in the Finder on that box, this computer shows up with the correct name, not the new-host name.
I think I will reboot the router - not simply turn it off/on but do the full reset using the button.
I will then reboot this box and see what happens.
Since I am the infinitely curious type, these kinds of things are quite interesting and I don't let them go until they are resolved.
It certainly is an interesting issue.
Maybe you could try giving your Mac a fixed IP address (outside your router's DHCP range), assuming this is a typical home router situation and not a corporate router.
Give your Airport and your Ethernet interfaces the *EXACT SAME* fixed IP address.
I suspect that might stop your router from assigning new names to your Mac.
With this configuration you can switch between Airport and Ethernet and back again, always keeping the same IP address. With an identical fixed IP address on both ethernet and Airport you can even do this while in the middle of a file transfer and not miss a beat, except that in home transfers speed up when switching to etherent and the other system is also on ethernet.
The Mac has an ordering to its networking interfaces, and as long as your Ethernet is higher in the list than Airport, you will switch to the Ethernet when plugged in, and switch to Airport when ethernet is unplugged.
You can change the Service Order via the System Preferences -> Network -> Left side Column -> Gear icon -> Set Service Order.
One of the Leopard Network options is DHCP with manual address. I think it's worth a try, but I still don't know the whyfor, since it's a recent thing. I have had this modem for several months since I got FIOS, and this is the first time (maybe the second) it's happened.
It's still not clear to me if the router is simply the result of the problem or causing it.
I will reboot later, with the Ethernet cable unplugged and AirPort off and see what happens.
I will look into the router GUI from my other MBP and see what shows up.
Bang A. Lore wrote:
I see nothing useful.
Then you must not know what Bonjour is. Look it up.
I know what BonJour is, so please explain why this issue just happened today, when I have changed nothing on my computer for several months, and how it relates to BonJour?
Thanks. I appreciate your input.
It was the router
When I unplugged the Ethernet cable from the box, and closed/reopened terminal, the prompt was correct. As soon as I plugged the Ethernet cable in, the prompt (after closing and restarting terminal) was the wrong one.
I left the Ethernet Network settings alone, but changed the AirPort Network settings to use DHCP with manual address and used the same IP as the Ethernet connection.
Without a reboot, everything is back the way is should be.
Once caveat - I noticed that in the network settings, Configure IPv6 was set to automatic. I turned it off in both Airport and Ethernet. That's for a future time.