Re: Changing hostname?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Dear Shu.

Thanks for that explanation.

>> Concerning RH or CentOS: I have to define /etc/hosts on all machines
>> that do not obtain their hostname via DHCP. I have not yet figured out
>> that the HOSTNAME variable in /etc/sysconfig/network is used in any
>> form (correct me if I am wrong).
>
> See /etc/rc.d/rc.sysinit. In that file you can find following lines
>
> ----
> (snip)
>
> if [ -f /etc/sysconfig/network ]; then
>    . /etc/sysconfig/network
> fi
>
> (snip)
>
> # Set the hostname.
> update_boot_stage RChostname
> action $"Setting hostname ${HOSTNAME}: " hostname ${HOSTNAME}
>
> (snip)
> ----
>
> The ${HOSTNAME} variable comes form /etc/sysconfig/network.

I still wonder why it also works if hostname is only set in /etc/hosts like:

127.0.0.1       localhost
10.0.0.50       myserver.domain.example        myserver

and $HOSTNAME is undefined.

Best Regards
Marcus
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux