ubuntu hostname related issues
1, modify the hostname file
The contents of the file is displayed in the host name
sudo vim /etc/hostname
2, modify the hosts file
If you execute the command sudo appear
sudo: unable to resolve host
(无法解析主机)
Modify the hosts file contents instead of 127.0.0.1 hostname
sudo vim /etc/hosts
content:
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
The hostname localhost instead
3. Change the host after reboot
sudo reboot