In the Ubuntu environment, assuming that the machine name is abc (the hostname of the machine), this warning message appears every time sudo is executed:
sudo: unable to resolve host abc
Although sudo can still be executed normally, it is set directly from /etc/hosts , so that abc(hostname) can resolve the IP of 127.0.0.1.
Just add the hostname after 127.0.0.1 localhost:
127.0.0.1 localhost abc
Reprinted from: http://blog.csdn.net/ichuzhen/article/details/8241847