“unable to resolve host” in Amazon EC2

This weekend I spent some time moving my Classic EC2 instances to VPC, changing their zones to keep the redundant etc… After that, I was getting a very annoying message every time that I used the “sudo” command.

unable to resolve host xxx.xxx.xxx.xxx

I solved it just adding my new hostname to the hosts files. In a trick way you can do that just running the following command:

echo " $(hostname)" >> /etc/hosts


Leave a Reply

Your email address will not be published. Required fields are marked *