LinuxQuestions.org
Register a domain and help support LQ
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, 03: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, 05:27 PM   #2
walker
Member
 
Registered: Nov 2003
Posts: 75

Rep: Reputation: 15
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, 05: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, 05:41 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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 05:43 PM.
 
Old 01-12-2005, 05: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, 05:57 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 05: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, 12:17 PM   #8
walker
Member
 
Registered: Nov 2003
Posts: 75

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:28 PM
correct syntax for a canonical file? rioguia Linux - Software 1 11-04-2003 03:11 AM
Canonical Hostname jarle Linux - General 2 07-18-2002 12:49 PM
canonical name ? hubergeek Linux - Networking 2 05-22-2002 01:34 PM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 06:01 PM


All times are GMT -5. The time now is 06:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration