Change hostname permanently from the Terminal without a restart

This quick tutorial explains how to change hostname permanently from the Terminal without a restart in Ubuntu 16.04.1.

Open the Terminal by keyboard shortcut Ctrl + Alt + T.

Show current hostname:
hostname

Set new static hostname:
hostnamectl set-hostname YOUR-HOSTNAME

Restart the system service that manages user logins:
systemctl restart systemd-logind.service

Check new hostname:
hostname

Share and Enjoy
  • Facebook
  • Twitter
  • LinkedIn
  • del.icio.us
  • StumbleUpon
  • RSS
  • email
  • PDF

Published by

Samuel

Ph.D. Student in the Department of Computer and Systems Sciences, Stockholm University.

Leave a Reply

Your email address will not be published. Required fields are marked *