Enter/etc directory or edit/etc/hosts file directly
The following are the contents of my Hosts file:
127.0 . 0.1 localhost 127.0 . 1.1 wakasann-rev-0 # The following lines is desirable for I PV6 capable hosts :: 1 ip6-localhost ip6- Loopback fe00::0 ip6-localnet Ff00::0 ip6-1 ip6-allnodes ff02::2 ip6-< Span style= "color: #000000;" >allrouters
Because I am in the settings, information, device name modified to: wakasann-rev-0
Each time sudo is displayed, it will appear once:
sudo: Unable to resolve host: wakasann-rev-0
Can see outside of 127.0.0.1 localhost, the second behavior of my host name,
1. The name of the device can be modified to the host name in the Hosts file "wakasann-rev-1-0" (I use this, modify the device name, need to log off once, and then log in, only valid)
2. You can change "wakasann-rev-1-0" to the device name I set "wakasann-rev-0"
Reference links are:[Ubuntu] sudo: Unable to resolve host issues
Ubuntu cannot resolve host after modifying host name