hostname resetting to localhost on unclean reboot
I've recently installed Fedora Core 1 and I'm trying to change the hostname. For this example, let's say I want to call my computer 'newmachinename'. I found that by running 'hostname' command like so:
would change the hostname as it's listed at
and would stay changed until I reboot, from which time it would go back to 'localhost'.
Then, I did the following which remained stable on reboot:
-changed /etc/sysconfig/network HOSTNAME value to newmachinename.
-added 'newmachinename' to /etc/hosts just after 'localhost' and on the same line.
I've rebooted several times and the 'newmachinename' persists.
Now, I have a different problem in that I'm trying to get my wireless card to work (topic for a different post). Anyway, upon inserting the wireless card, my laptop locks up completely and the only thing to do is to flip the on/off switch. When it finally boots up again, the machine has returned to its default name of 'localhost'. Also, when rebooting, I see a message stating that some recovery is going on. So, I think the hostname configuration is being backed up somewhere and rewritten on an unclean reboot.
Is there a more robust mechanism for setting the hostname so that it remains stable?
One possible catch is that I need to use dhcp and so I don't have a fixed IP address.
Thanks for any insights.
Last edited by brian_h1; 05-13-2004 at 08:52 AM.