sudo: unable to resolve host [hostname]

March 17, 2014 31.4k views
Hi there, I just created my first droplet today. I added an user and give it root privileges. Whenever I "sudo", I get "unable to resolve host [myhostname]". Although my command is executed fine, I still want to get rid of this? Belows are my /etc/hostname and /etc/hosts knguyen@knguyen:~$ cat /etc/hostname knguyen knguyen@knguyen:~$ cat /etc/hosts localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
3 Answers
This thread helped me:

You may add your domain name to your /etc/hosts

like this

knguyen@knguyen:~$ cat /etc/hosts knguyen

Have another answer? Share your knowledge.