View Full Version : shouldn't terminal prompt include 'localhost'?
erehnke
03-04-2002, 12:19 AM
for some reason, since i reinstalled OSX, my terminal prompt no longer displays '[localhost:~] erehnke% '
(my username is 'erehnke')
but, rather, displays the name of my isp dhcp server instead:
'[dhcpp1:~] erehnke%'
that string also shows up as my hostname.
how do i get 'localhost' to show up in the terminal prompt and as the hostname?
thanks
eric rehnke
erehnke@mac.com
gowrann
03-10-2002, 05:21 AM
Have you tried to edit your "hostconfig" file in private/etc. Make a backup before you edit.
# Network configuration
HOSTNAME=-localhost-
NETINFOSERVER=-YES-
ROUTER=-AUTOMATIC-
erehnke
03-10-2002, 06:22 PM
well...that did it!
i did see that setting in /etc/hostconfig but it was set to:
HOSTNAME=-AUTOMATIC-
and I wasn't sure that i should mess with that.
anyway, that's a journey for another day....
thanks again for your help.
ps..if you DO know why this HOSTNAME was set to -AUTOMATIC- i'd sure like to know......
thanks
eric:D
ashill
03-11-2002, 01:25 AM
The normal behavior is actually to show the hostname, not 'localhost'. (/etc/hostconfig has always had HOSTNAME=-AUTOMATIC-.) Early versions of OS X had a bug that set the hostname to 'localhost' even when there was a known hostname.
I think that the prompt doesn't get 'fixed' when you normally upgrade, but it does when you reinstall; that's why you didn't see it until you reinstalled.
-Alex Hill
erehnke
03-11-2002, 10:26 PM
i stopped at the local apple store to check the setting for HOSTNAME in another system and found that, even though it was set to -AUTOMATIC-, the terminal prompt still showed 'localhost'.
i have searched online as well as in all the osX books i could lay my hands on but still cannot find out where the 'localhost' hostname comes from.
i've asked apple support (they don't support the os at this level, they say), the folks at the apple store..etc etc. But still no answer.
i DO know that when i reinstalled my system (now up to 10.1.3), i was online and connected to the internet through my cable modem ISP so the mac evidently got confused about what the hostname SHOULD be.
I know this is not a big thing since it DOES work like it should at the moment. Only, what happens when i decide to give my system a REAL name like the other boxes on my home network.
in linux/freebsd you can simply change the settings in one file (i can't remember the name of it...i think it is /etc/rc.conf ....you set hostname and ip address there)
i'll keep searching and i KNOW that eventually i'll find out how this HOSTNAME business works...
any help is much appreciated.....THANKS VERY MUCH FOR RESPONDING>>>>
eric rehnke
erehnke at mac dot com ' this address form to foil email address spammers;)
hschickel
03-12-2002, 04:09 AM
It sounds like you've changed lookupd via /etc/lookupd or via NetInfo Manager /Locations/lookupd. Is that possibly the case?
Hugh
batmanppc
03-12-2002, 10:01 AM
Mac OS X dynamically updates it hostname based on the reverse lookup of the ip assigned to it when HOSTNAME is set to -AUTOMATIC-. The reason you saw localhost at the store was because they most likely didn't have the reverse dns entries setup on their network.
erehnke
03-12-2002, 01:16 PM
after looking over my system last evening, i realized that i had the Network location set to AUTOMATIC while the TCP/IP configuration was set to 'Using BootP'.
I tried changing this to 'Using DHCP' (like they had at the store) and then removing the 'HOSTNAME=-localhost-' setting in etc/hostconfig and rebooting.
IT WORKS!.....Now my terminal prompt shows 'localhost' like it should.
when i run the machine from my office i had to create a custom location that uses the 'Using BootP' configuration.
It ALL WORKS!!!!!!
THANKS for all your help!!!!!! :D
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.