LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 01-12-2005, 02:12 PM   #1
zoso
Member
 
Registered: Dec 2004
Distribution: Debian, Gentoo, Slackware, FreeBSD
Posts: 68

Rep: Reputation: 15
Canonical Hostname


How can I set this? Is the command hostname, or is it another one?
 
Old 01-12-2005, 04:27 PM   #2
walker
Member
 
Registered: Nov 2003
Distribution: antiX-17.4.1_x64 base Custom
Posts: 193

Rep: Reputation: 38
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
 
Old 01-12-2005, 04:30 PM   #3
zoso
Member
 
Registered: Dec 2004
Distribution: Debian, Gentoo, Slackware, FreeBSD
Posts: 68

Original Poster
Rep: Reputation: 15
Awesome, thanks.
 
Old 01-12-2005, 04:41 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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.
 
Old 01-12-2005, 04:42 PM   #5
zoso
Member
 
Registered: Dec 2004
Distribution: Debian, Gentoo, Slackware, FreeBSD
Posts: 68

Original Poster
Rep: Reputation: 15
Ditto.
 
Old 01-12-2005, 04:57 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 01-12-2005, 04:59 PM   #7
zoso
Member
 
Registered: Dec 2004
Distribution: Debian, Gentoo, Slackware, FreeBSD
Posts: 68

Original Poster
Rep: Reputation: 15
Oh, sorry. It's for Debian (Sarge). I don't have the '/etc/rc.d' file.
 
Old 01-13-2005, 11:17 AM   #8
walker
Member
 
Registered: Nov 2003
Distribution: antiX-17.4.1_x64 base Custom
Posts: 193

Rep: Reputation: 38
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Canonical Hostname herc Slackware 9 02-01-2004 11:28 AM
correct syntax for a canonical file? rioguia Linux - Software 1 11-04-2003 02:11 AM
Canonical Hostname jarle Linux - General 2 07-18-2002 11:49 AM
canonical name ? hubergeek Linux - Networking 2 05-22-2002 12:34 PM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration