In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to modify the host name in linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Linux modify the hostname: 1, change the value after HOSTNAME to the hostname you want to set in network; 2, change the localhost.localdomian in hosts to the hostname you want to set.
Modify hostname under Linux system
After the Linux system is installed, there will be a default hostname. Here, take the CentOS system as an example. The default hostname is localhost.localdomain. In order to make it easy to use, we often need to modify the hostname. The following is a demonstration of the method of permanently modifying the hostname.
Step one:
Change the network file under / etc/sysconfig, type vi / etc/sysconfig/network at the prompt, and then change the value after HOSTNAME to the hostname you want to set.
Click button I to enter insert editing mode
Step 2:
Change the hosts file under / etc, enter vi / etc/hosts at the prompt, and then change localhost.localdomian to the hostname you want to set
Step 3: turn off the firewall:
Meaning: when opening up all port numbers (80meme443 and 8001), the firewall will grab the port number directly, and finally need to shut down the firewall.
With the command to turn off the firewall:
Service iptables stop turn off firewall service iptables start start firewall service iptables status view firewall status service iptables restart restart firewall
Icon of successful firewall shutdown:
With the firewall turned off, boot:
Chkconfig iptables off turn off firewall enable start chkconfig iptables-- list to see if the firewall is completely off boot start step 4:
Restart the virtual machine: reboot
The above is all the contents of the article "how to modify the hostname in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.