Changing the hostname.
How do I change the hostname on my linux box from the default one. I am running Slack.
--------------------------------------------------------------------------------- Thx , KrazyKid. :newbie: |
Change the hostname stored in the /etc/HOSTNAME file.
If you want to setup the hostname as well as other network properties, you can use the 'netconfig' script. |
hostname name-of-host-that-you-want
ahh.. crabboy beat me.. i never get beaten.. :cry: |
ummm, this is a dumb way to do it unless you also change /etc/hosts, lots of things will start not to work, but nice try guys.
Why not run hostname from the command line and it will change it all for you??? simple |
Actually that is what I mentioned.. just use the hostname command.. and come to think of it, the netconfig script will make the updates as well, but unfortunately there is no /etc/hostname file.. at least my Slack boxes don't have that file, never did either.. :)
that's funny and just notice, everyone's reply in this thread either ends with boy or kid.. :D |
Thx all for your help with my system.:newbie:
|
Well, can somebody else get in on the fun here?
Actually the proper method is to use /sbin/netconfig that was suggested earlier. If the machine is networked then it is also the best here because the machine is still using the default name of darkstar.example.net then it has not been run at all. If not, then manually changing a file is OK. The netconfig script writes/creates several files. /etc/HOSTNAME (note: the uppercase) /etc/networks /etc/resolv.conf /etc/hosts /etc/rc.d/rc.inet1 That is all that I can recall at the moment. HOSTNAME is the only file that doesn't pertain to networking other than it contains the fully qualified domain name for the others to use. To change the hostname manually without the networking parts. Modify the /etc/HOSTNAME to contain the name desired and then run the command hostname new-host-name If the HOSTNAME file is not modified then it will revert back on the next boot because it will be read by /etc/rc.M script. To my knowledge the hostname command does not modify any files. If the machine is networked then the /etc/hosts file must also be updated manually. In one way or another you were all right. Please feel free to correct anything that I may be amiss. Cheers |
All times are GMT -5. The time now is 07:06 PM. |