Ubuntu can't resolve host solution

After modifying the name of the ubuntu host, when executing the sudo command, it will prompt sudo: unable to resolve host, that is, the host cannot be resolved.
Solution:

sudo gedit /etc/hosts

Find the following line:
127.0.1.1 XXX
Modify it to:
127.0.1.1 (your current hostname)
Note: You can use all replacements

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325553896&siteId=291194637