Have you defined 'locahost' in your hosts file?
Its not pre-defined, it is something you have to do so windows knows where the 'localhost' domain is i.e. which ip address to go to.
edit c:\windows\system32\drivers\etc\hosts
make sure you have these entries in there
127.0.0.1 localhost
::1 localhost
HOW TO EDIT THE HOSTS FILEThe 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 Privilages.
Locate your editors icon on the desktop or from the Start menus ( notepad will do if you have nothing else )
left 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.