How To Install Hostname On Debian, Ubuntu, Arch, Kali, CentOS, Fedora And Raspbian?

How To Install Hostname On Debian, Ubuntu, Arch, Kali, CentOS, Fedora And Raspbian?

hostname

Show or set the system’s host name.

Maintainer: Michael Meskes


Section: admin

Install hostname

  • Debian apt-get install hostname Click to copy
  • Ubuntu apt-get install hostname Click to copy
  • Arch Linux pacman -S hostname Click to copy
  • Kali Linux apt-get install hostname Click to copy
  • CentOS yum install hostname Click to copy
  • Fedora dnf install hostname Click to copy
  • Raspbian apt-get install hostname Click to copy

Show or set the system's host name.

How to use hostname?

Below are few example commands for hostname that you can use in the terminal.

Show current host name:
hostnameClick to copy
Show the network address of the host name:
hostname -iClick to copy
Show all network addresses of the host:
hostname -IClick to copy
Show the FQDN (Fully Qualified Domain Name):
hostname --fqdnClick to copy
Set current host name:
hostname new_hostnameClick to copy
Installing hostname command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Arch, Kali, CentOS, Fedora and Raspbian operating systems. Once you run the command it will install the latest version of hostname 2024 package in your OS.