how to change hostname

Página superior
Adjuntos:
Obtener este mensaje como un correo
+ (text/plain)
Eliminar este mensaje
Responder a este mensaje
Autor: Kevin Brown
Fecha:  
Asunto: how to change hostname
On RH6.x it is stored in a file.

/etc/sysconfig
vi network
HOSTNAME=<set the host name here>

I believe you have to reboot for a change that is just to this file, but should
be a command to change it on the fly. Looks like it's hostname

man hostname

NAME
       hostname - show or set the system's host name
       domainname - show or set the system's NIS/YP domain name
       dnsdomainname - show the system's DNS domain name
       nisdomainname - show or set system's NIS/YP domain name
       ypdomainname - show or set the system's NIS/YP domain name
       nodename - show or set the system's DECnet node name


> I am having trouble setting my hostame.  I have redhat 7.1.  I manually
> edited /etc/hosts to:
> 127.0.0.1       localhost.localdomain localhost
> 192.168.0.3     Shitty  Shitty.localdomain

>
> I have also used "hostname Shitty"
>
> But my hostname still shows up at my command prompt as
> "localhost.localdomain.
>
> What am I doing wrong here. How to I properly set my hostname?
>
> Thx