On 08/10/2009, at 9:26 PM, Daniel Kerr wrote:


There was a way to reset it via Terminal with a "permanent" set, but as mentioned you had to do that in Terminal. I found it on google somewhere, so
would need to refind it if anyone wanted.

Ok Daniel, you got me curious, so I have been "fiddling" around in Terminal (after doing some reading on Terminal from my many books). Now, I DON'T recommend people "fiddle" around in Terminal, especially if you don't know what you are doing. WARNING: Please don't attempt this until someone much more knowledgeable than I, confirms that this is safe and does work.
Ronni is certainly NOT a Terminal Guru!

Now the legalities of this post are over with, this is what I did:

When you Launch Terminal, the default shell "Bash" will present the last login time, followed by the command prompt. This is formatted to show the computer's name, followed by the current directory and then a dollar sign. Depending on the system and network configuration, the computer's name may change.

My hostname is "Rons-500GB-HD" (without the quotes)
The computer's host name is the one you type in the "Sharing" system preferences, and while a change in the hostname should not affect the performance of the machine, it is nice to have it be consistent. The first thing I tried is to use the "hostname" command to change the hostname:

1. Launch Terminal

2. I typed sudo hostname TEST

3. Hit Return

4. Typed  my password

5. Hit Enter

Then Quit Terminal and logged in again to see the change had taken place.
Yes, it had.

So then I moved on to changing it back to Rons 500GB HD which is the one I want to keep from changing.

As Daniel has previously said, the hostname can be changed dynamically by routers and other network devices through DHCP requests, which can have the hostname keep changing every time your IP address and other DHCP information is renewed. If this is the case, you may be able to set the router to never provide hostname information, or you can set the computer to never accept a hostname change.

To do this, you will need to add a line to the computer's hostconfig file using the following procedure:

        1.      Open the Terminal

        2.      Enter the following command:

                sudo pico /etc/hostconfig

3. Authenticate, scroll to the bottom of the file, and add the following line:

                HOSTNAME=Rons-500GB-HD

(Change "Rons-500GB-HD" to your desired hostname--no spaces)

4. Save the file and quit by pressing control-X, confirming the save with the "Y" key followed by "enter".

        5.     Quit Terminal

After this has been added to the file, the computer's hostname should not change even when you renew your DHCP lease.

This is yet to be confirmed ... I await in trembling anticipation of Daniel's reply ... or any other of our Terminal Gurus ;-) My MacBook Pro has not "blown up", Rons 500GB HD is showing in Sharing and in Terminal ... and I'm still connected to the Internet.

Cheers,
Ronni

17" MacBook Pro Intel Core 2 Duo
2.4 GHz / 4GB / 800MHz / 500GB
OS X 10.6.1 Snow Leopard



-- The WA Macintosh User Group Mailing List --
Archives - <http://www.wamug.org.au/mailinglist/archives.shtml>
Guidelines - <http://www.wamug.org.au/mailinglist/guidelines.shtml>
Unsubscribe - <mailto:wamug-unsubscr...@wamug.org.au>