Find the answer to your Linux question:
Results 1 to 6 of 6
I am trying to change my hostname but so far have been unsuccessful. I have edited the /etc/HOSTNAME file and used the 'hostname' command, but after reboot it always goes ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    8

    How to change the hostname


    I am trying to change my hostname but so far have been unsuccessful.

    I have edited the /etc/HOSTNAME file and used the 'hostname' command, but after reboot it always goes back to what it was originally.

    Any suggestions?

    Thanks!

  2. #2
    Linux Enthusiast
    Join Date
    Jun 2005
    Location
    The Hot Humid South
    Posts
    602
    Check under /etc/rc.d/rc.M, the hostname gets set somewhere in there!
    "Today you are freer than ever to do what you want, provided you can pay for it!" --Bad Religion

  3. #3
    Linux Engineer rong's Avatar
    Join Date
    Feb 2005
    Location
    California
    Posts
    803
    Quote Originally Posted by 37Seconds
    I am trying to change my hostname but so far have been unsuccessful.

    I have edited the /etc/HOSTNAME file and used the 'hostname' command, but after reboot it always goes back to what it was originally.

    Any suggestions?

    Thanks!
    After you change the hostname in /etc/HOSTNAME you need to reboot and then it will take effect. rc.M only calls HOSTNAME.

    ron
    registered Linux user #388382

    Have you checked here first?

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Dec 2006
    Posts
    8
    After you change the hostname in /etc/HOSTNAME you need to reboot and then it will take effect. rc.M only calls HOSTNAME.

    ron
    I did reboot after updating the /etc/HOSTNAME

    I have edited the /etc/HOSTNAME file and used the 'hostname' command, but after reboot it always goes back to what it was originally.
    But after the reboot, it always goes back to original hostname.

    Any other suggestions?

    Thanks for the help.

  6. #5
    Linux Engineer rong's Avatar
    Join Date
    Feb 2005
    Location
    California
    Posts
    803
    Quote Originally Posted by 37Seconds
    I did reboot after updating the /etc/HOSTNAME
    But after the reboot, it always goes back to original hostname.

    Any other suggestions?
    All I can tell you is that after doing a reboot after editing HOSTNAMES it works here. Other than that I do not know.

    ron
    registered Linux user #388382

    Have you checked here first?

  7. #6
    Just Joined!
    Join Date
    Feb 2003
    Posts
    6
    Quote Originally Posted by 37Seconds
    I did reboot after updating the /etc/HOSTNAME

    But after the reboot, it always goes back to original hostname.

    Any other suggestions?

    Thanks for the help.
    What about the /etc/hosts? Is the hostname listed in /etc/hosts the same as /etc/HOSTNAME?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •