I have this issue on AWS on some servers. Whenever I run sudo the terminal is stuck doing seemingly nothing, until it finally spits out this error message. My terminal looks like this:
ubuntu@(none):~$ sudo true
sudo: unable to resolve host (none)
What can I do to solve it?
Update: Solved! It was all in /etc/hostname. On two of our sick servers it looked like this:
ubuntu@(none):~$ cat /etc/hostname
linux-web-n ip-10-128-##-##
While on a server without this issue we had:
ubuntu@ip-10-128-##-###:~$ cat /etc/hostname
ip-10-128-##-###
Removed the linux-web-n portion, rebooted and everything was fine. Thanks. :)
/etc/hostnameand/etc/hosts. – arrange Aug 31 '11 at 20:24