Introduction





A hostname is a user-generated custom name which identifies a computer system in a network. In Ubuntu 20.04, users assign a hostname to the machine during OS setup.

You may decide to change your computer’s hostname for several reasons. For example, no two computers on a network can have the same hostname and, if you find yourself in this situation, you will have to change the hostname to avoid a network conflict.

In this tutorial, you will learn how to change a hostname on Ubuntu 20.04 using the Linux command line or GUI.

How to Check Current Hostname on Ubuntu 20.04

To check the current hostname of your Ubuntu system, use one of two available commands.

  • The hostname command displays only the hostname itself.