Q:

Sudo command hangs

Every time I try to execute sudo su - or any other sudo command for this matter my server hangs, sometimes it take 10 mins to respond and sometimes it never does.  
I checked /etc/hosts file which was configured correctly.  I also checked /etc/resolv.conf file which looked good as well. 
any suggestions?  
I am running redhat 6.9

A:

Had the same problem on Ubuntu 16.04 on a newly created openstack remote vm.  sudo su hanged for many seconds, maybe up to a minute, before it either worked or not.  When it worked it could be made quick and reliable by running this once as root:
echo 127.0.0.1 localhost $(hostname) >> /etc/hosts

