Reputation: 2224
I am having several issues with the DNS localhost on my computer.
Some instruction is redirecting all my explorers, including visual studio somewhere else than 127.0.0.1 when I visual studio or any browser looks for localhost.
Where can such thing be happening? I recently changed my hosts file to point localhost somewhere else, but then it did not work so I switched it back, so that cant be the problem.
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
I have also unistalled and installed IIS, so is not a problem of iis not redirecting properly..
I am not being able to run Visual Studio solutions because of this problem.
I have tried pining 127.0.0.1 and it responds, I have also tried localhost and it also works, but when I type localhost on a browser it redirects to a "404" page.
Upvotes: 2
Views: 24988
Reputation: 2930
I added a binding to the site that accepted IP address 127.0.0.1 over port 80 and was able to connect.
Upvotes: 2
Reputation: 1764
I just had this problem too and it turned out to be an issue with Default Web Site's bindings in IIS. I had specified the "Host Name" to be the server's domain name, meaning external access worked fine but trying to access any IIS page through localhost returned a browser 404 error.
Simply clearing that "Host Name" field and leaving it blank fixed the problem for me.
Upvotes: 5
Reputation: 41
Make sure that IIS is actually configured to listen on 127.0.0.1 (perhaps you removed the binding previously?)
netsh http show iplisten
IP addresses present in the IP listen list:
127.0.0.1
You can add additional IPs like so:
netsh http add iplisten ipaddress=10.0.0.10
Upvotes: 4