Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Whenever I use sudo, I get this:

sudo: unable to resolve host dave00-G31M-ES2L

Here is my /etc/hosts:

dave00@dave00-G31M-ES2L:~$ cat /etc/hosts
127.0.0.1   localhost
127.0.1.1   dave00-G31M-ES2

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

I logged out/in already. How can I solve this?

share|improve this question
4  
I recommend against closing this question as too localized. There are many users who may mistakenly think they've put one name in their hosts file but put in a different name instead, especially since on many networks, computers are similarly named. This question (and answer) would show up when someone searches with that problem, and the answer would prompt them to check for such discrepancies, even though the exact misspelling would be different. – Eliah Kagan Aug 18 '12 at 11:09

closed as too localized by Gilles, izx, RolandiXor, Mitch, Call me V Aug 23 '12 at 15:58

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

up vote 10 down vote accepted

Your hostname (dave00-G31M-ES2L) is not represented in /etc/hosts. Add an L to this line:

127.0.1.1   dave00-G31M-ES2

So it becomes:

127.0.1.1   dave00-G31M-ES2L

In order to accomplish this, open a console (press Ctrl+Alt+T) and type:

sudo gedit /etc/hosts

Add the letter L as mentioned, save and exit.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.