Announcement

Collapse
No announcement yet.

How to change the hostname on Ubuntu without a restart?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by Elliott View Post
    It takes a correct X11 authentication token (xauth list) and replaces the old hostname with the new hostname (sed). At that time awk puts quotes around the first argument to xauth add since xauth's input and output format are not symmetric.
    Thanks for the clarification. I had always restarted for the changes to take effect. +1

    Comment


    • #17
      Without restart:
      • change hostname in /etc/hostname
      • update /etc/hosts properly
      • sudo sysctl kernel.hostname=mynew.local.host

      Check your current hostname with hostname -f

      Comment


      • #18
        I think that must do the job.
        Code:
        sudo hostname your-new-name
        sudo /etc/init.d/networking restart

        Comment


        • #19
          Originally posted by Jake_J View Post
          I think that must do the job.
          Code:
          sudo hostname your-new-name
          sudo /etc/init.d/networking restart
          I don't think this will make restart.

          Comment

          Working...
          X