localhost doesn't point to 127.0.0.1

alsotang picture alsotang · Sep 19, 2012 · Viewed 7.6k times · Source

when I ping localhost, the answer is:

alsotang@alsotang-laptop:~$ ping localhost
PING localhost (61.139.8.100) 56(84) bytes of data.

but the hosts file has a record that 127.0.0.1<feff> localhost

How can I fix it??

ps: my system is Ubuntu 10.04

Answer

Sarah Messer picture Sarah Messer · Sep 28, 2016

If someone has made a mistake with your DNS server, that might cause an issue. Try nslookup localhost. If there is a DNS server entry for localhost (other than 127.0.0.1), contact the server admin.