2

So...

'http://server_ip_address/application' works locally

'http://dns_address/application' works locally

'http://computer_name/application' works locally

'http://localhost/application' does not work locally

Any ideas on getting localhost to work again? It does work for the browsing the root however.

This is IIS 7.5 and ASP.NET MVC 2 running in classic mode.

1
  • what is output of "ping localhost" Commented Mar 7, 2011 at 18:17

4 Answers 4

4

This is happening because I am only allowing SSL for the application which is enforced by a redirect mechanism to the SSL page AND the SSL only listens on the correct port.

Thanks for the help guys, I really appreciate it.

Sign up to request clarification or add additional context in comments.

Comments

4

open this file c:\windows\system32\drivers\etc\hosts with the notepad and add the lines

127.0.0.1       localhost

if it is commented (default, line start with ;) then uncomment it.

and try it again.

bad: (ipv6 problem)

C:\Users\Administrator.DEVJC>ping localhost

Pinging DEVJC.vaio.cl [::1] with 32 bytes of data:
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
     Minimum = 0ms, Maximum = 0ms, Average = 0ms
Control-C

good: (ipv6 and ipv4 compatible)

C:\Users\Administrator.DEVJC>ping localhost

Pinging DEVJC.vaio.cl [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
Control-C

Microsoft says "# localhost name resolution is handled within DNS itself." but it is a lie (an half-lie). Sometimes is true but in a few cases it fail (or it try to resolve externally = slow)

2 Comments

I am beginning to think it is because of how the bindings are configured. You are right about the hosts part though as far as being commented out. I'm still trying to understand what is causing it.
I'm not sure the default (with localhost commented out in hosts) is bad. Yes, ping localhost returns IPv6 results. But ping -4 localhost returns 127.0.0.1.
2

You can also resolve by adding the Binding information in your IIS. To do this:

  1. Open IIS
  2. Select Default Web site
  3. On right side actions panel, select Bindings. You will get site bindings screen
  4. Add a new binding adding 'localhost' in the Host name field
  5. IP Addresses field can contain text 'All Unassigned'
  6. Then save and reset IIS

After this I think you should be able to browse all applications hosted in your IIS with localhost.

Comments

1

I found my problem , In my server I Have Microsoft Thread Management Gateway (Microsoft TMG) in the firewall policy there are "HTTP Protocol Policy" Right click it --> "Configure HTTP" --> "General" --> "URL Blocking" --> uncheck block high bit characters --> click OK then Apply

wait to TMG sync firewall. then go to your site and check your problem.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.