LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Canonical Hostname (https://www.linuxquestions.org/questions/linux-newbie-8/canonical-hostname-276991/)

zoso 01-12-2005 02:12 PM

Canonical Hostname
 
How can I set this? Is the command hostname, or is it another one?

walker 01-12-2005 04:27 PM

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
:)

zoso 01-12-2005 04:30 PM

Awesome, thanks.

Tinkster 01-12-2005 04:41 PM

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

zoso 01-12-2005 04:42 PM

Ditto.

Tinkster 01-12-2005 04:57 PM

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

zoso 01-12-2005 04:59 PM

Oh, sorry. It's for Debian (Sarge). I don't have the '/etc/rc.d' file.

walker 01-13-2005 11:17 AM

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 02:54 PM.