Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a problem with sudo. Every time when I trying to use sudo I got this problem:

sudo: unable to resolve host ubuntu-server

My /etc/hosts file:

127.0.0.1       localhost
127.0.1.1       ubuntu-server

# 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

/etc/hostname gives:

ubuntu-server

I think there is some other setting that causes the unable to resole host, but I cannot find these.

share|improve this question
add comment

1 Answer

Edit the /etc/hosts, you have a typo 127.0.1.1 is not loopback, change it to 127.0.0.1, save and reboot.

share|improve this answer
    
This is the default configuration with Vagrant precise32. It uses 127.0.1.1 on that line... are you sure this is wrong? It was working fine until I tried changing my hostname away from the default. –  Mark Mar 1 at 2:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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