![]() There are two lines that we have to concern with and it must look like below: This file is positioned at the "/etc/hosts " file. We need to specify it for associating our hostname with a local computer. It tells our system which of the hostnames to connect with IP addresses. The second file is known as the "hosts" file. This file is positioned at the "/etc/hostname" file. Hence, enter whatever we like there for making it the hostname of our system. The system will read that one word and fixes it as our hostname. It is a plain text file along with one word inside it. The initial file is known as the "hostname". One of the most traditional and universal techniques involves changing two files and then rebooting our computer. Systemd would take care while resetting everything for us. There are some cases where the alias option is helpful and the use of it is no longer suggested. We can use the -alias or -a option for displaying the alias (also known as substitute hostname) of a host when one is fixed. It also enumerates each configured address on every network Interface. This option returns a line (empty)when no name of the alias is fixed. a: It is used for getting the hostname's alias name (if any). Some of the options are mentioned and discussed below:ġ. There are so many options available in the hostname command for different purposes. This command will show the current hostname of our computer inside the terminal window. Simply, type a command, i.e., hostname.To do so, we need to follow the following steps: Unless we are using any local DNS server, it will take a little setting up for making it smoothly run. ![]() It includes browsing various local web pages and applying SSH. Similarly a URL, we can replace that hostname where we would apply an IP address regularly. If we provide a hostname to our computer, it is a regular word that we understand and we can easily enter in to recognize that computer on our network. The hostnames operate in a similar way, only over a local network. This system available due to IP address is a little difficult and no one will do it. A DNS server links that name with the IP address of a server. The URL is composed of some regular words that we can understand such as "". When we visit any website, we type the URL of that website into our browser. Here, we are going to briefly explain the introduction of Hostname. Please do share your feedback and queries in below comments section.Before going to discuss how to change the hostname in our system, we need to know what is the meaning of the Hostname. I hope you have found it informative and insightful. Verify the new hostname by running following command that’s all from this post. In the following window, specify the hostname that you want to set and then choose OK and hit enter.Ĭhoose OK in the following window and then quit the nmtui tool. It’s simple and straight forward, start nmtui tool by running, $ nmtuiĬhoose ‘ Set system hostname’ option and hit enter. Static hostname can also be set using nmtui tool. To remove pretty hostname, run $ sudo hostnamectl -pretty set-hostname "" Set hostname using nmtui tool To remove the static hostname, run $ sudo hostnamectl set-hostname "" ![]() Perfect, above shows that static and pretty hostname are set. To set the pretty type hostname then use –pretty arguments in hostnamectl command, example is shown is below: $ sudo hostnamectl -pretty set-hostname "PKUMAR_LinuxBuzz #Blog#" Verify the hostname using following commands, $ hostname To set the static hostname, run the following hostnamectl command,Įxample $ sudo hostnamectl set-hostname "" When we run hostnamectl command without any arguments then it will display the current hostname, $ hostnamectlĪlternate way to check the hostname of your system is by running hostname command without any options, example is show below Set Static Hostname In modern linux distributions like RHEL, CentOS, Rocky Linux, Debian and Ubuntu hostnamectl is available for setting up the hostname.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |