How to change the hostname in linux - Embedded

This is a discussion on How to change the hostname in linux - Embedded ; Hi, I am trying to change the host name of a linux machine. I have modified /etc/hosts as follows : 127.0.0.1 localhost.localdomain localhost ## /etc/nsswitch.conf is modified as follows : #hosts: db files nisplus nis dns ##hosts: files nisplus dns ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to change the hostname in linux

  1. How to change the hostname in linux

    Hi,
    I am trying to change the host name of a linux machine.
    I have modified /etc/hosts as follows :

    127.0.0.1 localhost.localdomain localhost
    ##< IP ADDRESS>


    /etc/nsswitch.conf is modified as follows :
    #hosts: db files nisplus nis dns
    ##hosts: files nisplus dns
    hosts: files


    /etc/sysconfig/network
    ##HOSTNAME=
    HOSTNAME=

    Then I have executed these on the shell :
    hostname

    service xinetd restart


    After executing these steps, my machine is not taking the new
    hostname.
    If I execute
    #hostname

    I get hostname as (none)

    Can anyone tell me what is that which I am missing here.
    Thanks in Advance!


  2. Re: How to change the hostname in linux

    guddu wrote:

    > I have modified /etc/hosts as follows :


    This is for the resolver only, not for the local hostname.

    Depending on your distro it might be possible to edit /etc/hostname. You can
    always set the hostname manually by using "hostname "

    Sven

    --
    "If you continue running Windows, your system may become unstable."
    (Windows 95 BSOD)

    /me is giggls@ircnet, http://sven.gegg.us/ on the Web

+ Reply to Thread