0

First of all, this question is not a duplicate of Change computer name of an Ubuntu desktop computer or Change Ubuntu Name.

I know to change hostname, I need to edit the file hostname and hosts under /etc. No problem with that. The problem is how to change hostname if the system has already booted into the wrong hostname, without a reboot. I.e., to change the hostname on the fly.

This was used to be done with /etc/init.d/hostname.sh, but now, under my Ubuntu 13.10 Saucy, that file is no longer there. How to change the hostname on the fly then?

3

/bin/hostname can be used to show or set the hostname of a system at run-time.

  • that's not what I want becaus it does not change the file hostname and hosts under /etc. It is effective only until the next reboot – xpt Jan 12 '14 at 5:03
  • 2
    /bin/hostname is how you change the hostname on the fly. Altering the configuration file is how you change the hostname at boot-time. – DopeGhoti Jan 12 '14 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.