Changing HostName OS X 10.5

Status
Not open for further replies.

SNGX1275

Posts: 10,615   +467
I'm having a bit of an issue with an old PowerMac G4 running Leopard.

Since day 1 of Leopard the computer has been named G4T with the login as Dave. This has worked fine for over a year, then recently something apparently changed and I don't know what it is. The problem is now it thinks it is G4T-2 and I can't seem to get it changed back.

The symptoms don't make a whole lot of sense to me either:
  • Windows 7 Professional 64bit sees the computer as G4T in Network. This is great, and what I'm trying to have it show up as.
  • My Belkin router's DHCP Client List has it showing as G4T-2
  • Both my Powerbook and my Mac Mini also see the PowerMac as G4T-2


What I've tried to do so far (with unsuccessful results):
  • Change the Computer Name in the WINS tab from Advanced on the Network System Preference panel. I've changed it to G4T, G4Tower and then back to G4T all with reboots inbetween, all with the same results as above.
  • Based on this page I typed in the terminal:sudo scutil --set HostName G4T.domain.com
  • Tried turning off the Macs on the network, then rechecking the Computer Name on the PowerMac, then rebooting my router. I also tried shutting down the PowerMac, then rebooting the router, then booting the PowerMac back up.
At this point I don't really know what else to do or where the problem actually lies. I'm thinking it might be my router but I don't know why reboots wouldn't fix it.

Any suggestions?
 
ouch.

my suggestion is to isolate, clean and then add incrementally -- let me explain.

First, find which system IS the Master Browser.

1) disconnect ALL systems from the router and reboot it.
2) get the Mac to see/show itself correctly
3) run this sequence on every PC
ipconfig /flushdns
net stop "dns client"
net start "dns client"​
4) attach the Mac to the router and prove internet access with ping www.google.com
5) attach the pc which was the Master Browser to the router and ping google until it shows correctly.

now investigate the Master Browser setting and how the Mac is viewed from it.

6) attach any other PCs one at a time and monitor the network
 
btw: Master Browser is seen by (admin logon)
run->cmd
nbtstat -n
and to FLUSH the Master Browser cache it's
nbtstat -RR
 
Just curious. What does the terminal respond with if you open it up and and type: hostname

Is it G4T? G4T-2? Just curious.

Also, how about this?
http://excitedcuriosity.wordpress.com/2007/08/24/mac-os-x-hostname-determination/

When the hostname is determined automatically, the OS steps through this list of possibilities and goes with the first valid name found:
  1. The name provided by the DHCP or BootP server for the primary IP address
  2. The first name returned by a reverse DNS (address-to-name) query for the primary IP address
  3. The local hostname (set in the Sharing pane of System Preferences)
  4. The name localhost

Sounds plausible. It suggests you change the line, "HOSTNAME=-AUTOMATIC-" in the file /etc/hostconfig to something like HOSTNAME=G4T.local or a FQDN if that's your wish.

The simplest way to do that is probably to issue this command:
Code:
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hostconfig
 
Ok, as it stands now I haven't tried jobeard's suggestion yet because its confirmed I got a new router for Christmas so that knocks my motivaton away to do that big process, just incase the new router fixes it. I'm beginning to think it will not, but I don't have enough knowledge on how these things work to back up that thought.

I did try Rick's suggestion, with no luck, probably because of user error. It seems the sudo command immediately prevents anything from working for me. The master password for the G4T is blank (unsafe I know, I know the risks and am willing to accept, don't need a lecture). When it asks for pass and I just hit enter, I'm presented with a command prompt again, rather than it opening TextEdit (or nano/pico). If I open without the sudo command, it does work, but HOSTNAME isn't listed there. These are: AFPSERVER, AUTHSERVER, AUTOMOUNT, NFSLOCKS, NISDOMAIN, TIMESYNC, QTSSERVER, WEBSERVER, SMBSERVER, SNMPSERVER

On a positive note, the whole reason I asked this was because Share Screen wasn't working since the name change happened, but now I got it working with a 'dave' guest account, so I just log in as that with my pass at the screen sharing prompt.
 
The master password for the G4T is blank (unsafe I know, I know the risks and am willing to accept, don't need a lecture). When it asks for pass and I just hit enter, I'm presented with a command prompt
again, rather than it opening TextEdit (or nano/pico).
no lecture, just fyi; Just like MS Runas will not support Users w/o passwords, neither will OS X for root access (which is what SU is doing :)

I'll await your results for the Master Browser reset cache ...
 
I'm still a bit confused on what Master Browser is and how it relates.. I figured out the command is for Windows and not OS X from trying it on both. The Win 7 machine is the master browser, but when I got the new router I intentionally started up the G4T machine first to prevent the router from getting any information from the Win 7 box. That is the only Windows machine I have on the network full time, although occationally a Win 7 laptop will connect.

Anyways, the problem is fixed. I did create a password for the main account on that machine so I could use sudo, I didn't know one had to be setup before. Then I did what Rick said by editing the /etc/hostconfig file, again (as expected) that HOSTNAME= part wasn't in there, but I figured I'd add it and if anything crazy happened I'd just remove it. Then I read some more on the page Rick linked and saw that it was mentioned in a preference file (/Library/Preferences/SystemConfiguration/preferences.plist). So I went through there and saw G4T, G4T-2, and G4T (2) mentioned in different places, I changed all of them to G4T and rebooted. Fixed!

/ I actually didn't know what I should write for the HOSTNAME= part, so I went by the same convention everything else was and wrote "HOSTNAME=-G4T-" without the quotes, on reboot I saw my computer was named -G4T- when I opened the terminal (although it was showing as G4T to my Powerbook. So I figured while I was working on it I might as well fix it properly so I went back and changed it to G4T without the - before and after and now it appears correctly in terminal and on the network. If I had to guess I'd say fixing the .plist was the most important part to fixing this issue since it showed all 3 names that I was coming up with in various places.
 
Status
Not open for further replies.
Back