Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
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.
|
 |
01-12-2005, 02:12 PM
|
#1
|
Member
Registered: Dec 2004
Distribution: Debian, Gentoo, Slackware, FreeBSD
Posts: 68
Rep:
|
Canonical Hostname
How can I set this? Is the command hostname, or is it another one?
|
|
|
01-12-2005, 04:27 PM
|
#2
|
Member
Registered: Nov 2003
Distribution: antiX-17.4.1_x64 base Custom
Posts: 193
Rep:
|
The simpliest way is to edit
/etc/rc.d/rc.sysinit (as root)
this is the part regarding hostname on my box after I've changed hostname
36
37 "if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
38 HOSTNAME=yellowstone
39 fi"
40
In the original file created by your distro you should see "HOSTNAME=localhost"
instead of localhost type the name you want to give to your box save the file and that did the trick!
If this will be helpful for you pls spend a second to click thanks button.
Cheers
walker

|
|
|
01-12-2005, 04:30 PM
|
#3
|
Member
Registered: Dec 2004
Distribution: Debian, Gentoo, Slackware, FreeBSD
Posts: 68
Original Poster
Rep:
|
Awesome, thanks.
|
|
|
01-12-2005, 04:41 PM
|
#4
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally posted by walker
The simpliest way is to edit
/etc/rc.d/rc.sysinit (as root)
|
What if one (like me, for instance :}) doesn't
have a etc/rc.d/rc.sysinit ? ;)
Or the hostname is being set from /etc/rc.d/rc.M ?
Cheers,
Tink
Last edited by Tinkster; 01-12-2005 at 04:43 PM.
|
|
|
01-12-2005, 04:42 PM
|
#5
|
Member
Registered: Dec 2004
Distribution: Debian, Gentoo, Slackware, FreeBSD
Posts: 68
Original Poster
Rep:
|
Ditto.
|
|
|
01-12-2005, 04:57 PM
|
#6
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
zoso, if this is for the slack-install have a look at
/etc/HOSTNAME and /etc/rc.d/rc.M
Unfortunately you had replied to my post before
I did my edit ;)
Cheers,
Tink
|
|
|
01-12-2005, 04:59 PM
|
#7
|
Member
Registered: Dec 2004
Distribution: Debian, Gentoo, Slackware, FreeBSD
Posts: 68
Original Poster
Rep:
|
Oh, sorry. It's for Debian (Sarge). I don't have the '/etc/rc.d' file.
|
|
|
01-13-2005, 11:17 AM
|
#8
|
Member
Registered: Nov 2003
Distribution: antiX-17.4.1_x64 base Custom
Posts: 193
Rep:
|
I didn't say it was for debian!!
For debian edit /etc/hosts in this way
127.0.0.1 (the name you want to give to the box) localhost
separated by spaces as above (it doesn't matter how many they are one or more iis equal)
It should work.
Let me now
walker
|
|
|
All times are GMT -5. The time now is 09:44 AM.
|
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
|
|