# The Ubuntu Forum Community > Ubuntu Specialised Support > Security > [ubuntu] sudo: unable to resolve host

## whoop

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

Please read this sticky thread:

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

----------


## whoop

I fixed it myself. I remembered that I had been messing with my domain name in network settings

----------


## whoop

thanks, Monicker. Guess I was sleeping on the job

----------


## The Cog

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

The Cog, I think you meant 127.0.1.1

----------


## capscrew

> 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

> 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

Back to sleep thread..

----------

