Adding or editing an entry in /etc/hosts

Martin Marcher martin.marcher at
Mon Jan 8 18:03:37 UTC 2007


Am 08.01.2007 um 16:24 schrieb Derek Broughton:

> Brian Lunergan wrote:
>> Based on Rebel Lion's suggestion my hosts file no contains:
>> localhost.localdomain localhost
>> ubuntu
> OK, that explains _that_ odd entry in my hosts file.  I just
> removed " othello" (my host name) from hosts a few days ago,
> because it was interfering with "hostname -d" (which I use for network
> identification) when I was not actually connected to a network. I  
> didn't
> recognize it, but assumed I must have added it.  Now I suspect my  
> fresh
> install of edgy did it.  Maybe it did have a use... :-)

A common use for those addresses are adblockers (maybe you installed  
one ages ago?). Purpose is (for example)


and you will never see any ads from ever again, but I  
strongly recommend against this if you don't know what you're doing  
for sure (so before doing anything like that just because it is  
written here RTFM :)).

There are a few packages that will do that for you.

> Can someone explain what is supposed to be?  Maybe it's just
> supposed to be "anything". I can't believe I've been using Linux for a
> decade and only just discovered that all 127.x.x.x addresses seem  
> to map to
> the local machine.

Yes is reserved for local host, everything with those IP  
addresse routes back to localhost.

Something I sometimes use is to let daemons I test listen on (or whatever) so that they don't interfere with other stuff  
on the system and still can be tested.

hth (and someone please correct me if I'm wrong the only use I found  
so far is exactly what I wrote in the last sentence)

More information about the ubuntu-users mailing list