PDA

View Full Version : [ubuntu] sudo: unable to resolve host



whoop
May 19th, 2008, 05:43 PM
All of a sudden when I use the sudo command I get the following line:
sudo: unable to resolve host whoop-desktop

what does this mean and what can I do about it ?

Monicker
May 19th, 2008, 06:13 PM
Please read this sticky thread:

http://ubuntuforums.org/showthread.php?t=773851

whoop
May 19th, 2008, 06:14 PM
I fixed it myself. I remembered that I had been messing with my domain name in network settings

whoop
May 19th, 2008, 06:17 PM
thanks, Monicker. Guess I was sleeping on the job

The Cog
May 19th, 2008, 07:41 PM
Yup. If you change the hostname in /etc/hostname, you must also fix up /etc/hosts so the new name resolves to 127.0.0.1. The safest way is to edit hosts and add the new name, then edit hostname, then go back to hosts to remove the old hstname.

linuxNewb
October 4th, 2011, 09:59 PM
The Cog, I think you meant 127.0.1.1

capscrew
October 4th, 2011, 11:57 PM
Yup. If you change the hostname in /etc/hostname, you must also fix up /etc/hosts so the new name resolves to 127.0.0.1. The safest way is to edit hosts and add the new name, then edit hostname, then go back to hosts to remove the old hstname.

I think you misspoke there. The hostname has to resolve to an interface on the host (any). This allows you to communicate with the host using...the host name. My desktop host (malibu) resolves to 192.168.1.3.
/etc/hosts
127.0.0.1 localhost
192.168.1.3 malibu surfrider

capscrew
October 4th, 2011, 11:59 PM
The Cog, I think you meant 127.0.1.1
Using 127.0.1.1 is due to a Debian bug. The IP 127.0.0.1 and 127.0.1.1 both resolve to the loopback address.

CharlesA
October 5th, 2011, 12:07 AM
Back to sleep thread..