How to Change Hostname on Ubuntu 20.04

📰 Medium · DevOps

Learn how to change the hostname on Ubuntu 20.04 using CLI or GUI methods, including temporary and permanent changes.

beginner Published 24 Apr 2026
Action Steps
  1. Check the current hostname using the `hostname` and `hostnamectl` commands.
  2. Make a temporary hostname change using `sudo hostname new-hostname`.
  3. Make a permanent hostname change using `sudo hostnamectl set-hostname new-hostname`.
  4. Edit configuration files `/etc/hostname` and `/etc/hosts` to make permanent changes.
  5. Verify the new hostname after making changes.
Who Needs to Know This

DevOps and system administrators can benefit from this tutorial to manage and configure Ubuntu systems.

Key Insight

💡 Use `hostnamectl` for detailed system info and permanent hostname changes.

Share This
🔍 Change your Ubuntu 20.04 hostname easily! 💻
Read full article → ← Back to Reads