Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-30-2002, 08:29 PM
|
#1
|
LQ Newbie
Registered: Jun 2002
Location: Northern, NJ
Distribution: Slackware
Posts: 20
Rep:
|
Changing the hostname.
How do I change the hostname on my linux box from the default one. I am running Slack.
---------------------------------------------------------------------------------
Thx ,
KrazyKid.
|
|
|
06-30-2002, 08:39 PM
|
#2
|
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821
Rep:
|
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.
|
|
|
06-30-2002, 08:41 PM
|
#3
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
hostname name-of-host-that-you-want
ahh.. crabboy beat me.. i never get beaten..
Last edited by trickykid; 06-30-2002 at 08:42 PM.
|
|
|
06-30-2002, 08:57 PM
|
#4
|
Member
Registered: Oct 2001
Location: Sydney
Distribution: Arch
Posts: 295
Rep:
|
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
|
|
|
06-30-2002, 09:02 PM
|
#5
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
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..
Last edited by trickykid; 06-30-2002 at 09:04 PM.
|
|
|
06-30-2002, 09:36 PM
|
#6
|
LQ Newbie
Registered: Jun 2002
Location: Northern, NJ
Distribution: Slackware
Posts: 20
Original Poster
Rep:
|
Thx all for your help with my system.
|
|
|
06-30-2002, 09:56 PM
|
#7
|
Senior Member
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180
Rep:
|
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 11:31 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|