Reputation: 421
My localhost is not working, But when I type 127.0.1.1 on browser its working. When I run localhost, I get following thing
Please advice me how to solve this.
Upvotes: 0
Views: 132
Reputation: 94642
This looks like you have not editied your HOSTS file properly.
Edit c:\windows\system32\drivers\etc\hosts
You should have at least these lines in there, UNCOMMENTED i.e. without a #
in column 1
127.0.0.1 localhost
::1 localhost
It is these lines that create the domain name localhost
Once the file is edited and saved either restart Windows or use these commands from a windows command windows started using "Run as Administrator"
net stop dnscache
net start dnscahce
HOW TO EDIT THE HOSTS FILE
The hosts file is protected by windows, in order to save it you must have Administrator privilages. Vista/W7/W8 you may think you are an Administrator BUT YOU ARE NOT. To successfully save the hosts file do this to launch your editor with Admin Privileges.
Locate your editors icon on the desktop or from the Start menus ( notepad will do if you have nothing else ) right click + shift over your chosen editor icon - will show a menu. select "Run As Administrator" from the menu. Navigate your editor to the c:\windows\system32\drivers\etc\hosts file. When you have made changes you will now be allowed to save them.
Upvotes: 1