alsotang
alsotang

Reputation: 1605

localhost doesn't point to 127.0.0.1

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

Upvotes: 7

Views: 19398

Answers (3)

Harshit Garg
Harshit Garg

Reputation: 2259

On linux and max platforms, ensure that your hosts file has content like this. You can try a editor restart, or system restart.

127.0.0.1       localhost
::1             localhost

This is a DNS issue. For additional help, you can refer the following resources

  1. Virtual Host
  2. windows specific
  3. Blog on DNS

Upvotes: 1

Sarah Messer
Sarah Messer

Reputation: 4023

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.

Upvotes: 2

Iti Tyagi
Iti Tyagi

Reputation: 3661

You need to check your host file.

    127.0.0.1 localhost

Do the following:

    Go to ->windows->system32->etc->host
    remove-> ::1 localhost
    set-> 127.0.0.1 localhost

Upvotes: 3

Related Questions