Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system settings #7

Open
KarelWintersky opened this issue Sep 23, 2022 · 1 comment
Open

system settings #7

KarelWintersky opened this issue Sep 23, 2022 · 1 comment

Comments

@KarelWintersky
Copy link
Owner

https://linuxhint.com/change-hostname-debian/

@KarelWintersky
Copy link
Owner Author

Hostname is usually given to computers attached to a network, it uniquely identifies your system over the network. In Debian (Linux OS), hostname is usually set during the installation of the system but you can change your Hostname even after the installation by different approaches. In this Article, various methods to change Hostname are discussed in detail.

The “static” host name is default hostname, maintained in the /etc/hostname file and can be selected by the user. The “transient” hostname is a dynamic hostname that the kernel keeps track of and assigned to the machine by services like DHCP or mDNS after it boots up.

You can follow any of the one method from 6 methods mentioned below to change Hostname in Debian 11:

Changing Hostname by using “hostname” command
Changing Hostname by using “hostnamectl” command
Changing Hostname by using “nmcli” command
Changing Hostname by using “nmtui” command
Changing Hostname using sysctl command
Changing Hostname in /etc/hostname file

Method 1: How to change Hostname by using “hostname” command

The “hostname” command changes the transient host name.
Step 1: Check current Hostname

Check the current hostname by below mentioned command:

hostname

Step 2: Change Hostname

Simplest way to change Hostname in Debian 11 is using hostname command, to change hostname to linuxhint run the below mentioned command:

sudo hostname xxx

Method 2: How to change Hostname by using “hostnamectl” command

The simplest and standard method to change/set Hostname permanently is using the “hostnamectl” command. Follow the steps below to successfully change Hostname using this command.

The “hostnamectl” command changes the static host name of the system.
Step 1: Check current Hostname

To check for present Hostname run the below mentioned command:

hostnamectl

Step 2: Change Hostname

Run the below mentioned command to change Hostname to “linuxhint” using “hostnamectl”:

hostnamectl set-hostname linuxhint

Method 3: How to change Hostname using nmcli command

The “nmcli” command changes the static host name of the system.
Step 1: Check current Hostname

Check the current hostname by below mentioned command:

hostname

Step 2: Change Hostname

Another way to change Hostname is using nmcli(network manager command line interface) command by below mentioned command:

sudo nmcli general hostname linuxhint

Change “linuxhint” to hostname which you want to set:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant