75

Like a lot of programmers, I test sites locally.
I use the hosts file to map domain names to my local ip (127.0.0.1).

I use qualified domain names, usually with a "d" subdomain (for "development").

For example:

d.somewebsite.com 
d.anotherwebsite.com 
and so on...

In Microsoft edge, most of the web sites work. However, a couple of them do not. There is nothing special or weird about the domain names that won't work. Just a simple d.someletters.com.

They work fine in Chrome, IE, and Firefox.

In Edge, I get the error message: "Hmm, we can't reach this page."

At first I thought it wasn't resolving the IP. However, I realized when I made a typo on another non-related url, that requests which are not routed by the hosts file are sent to my ISP to be resolved. If my ISP can't resolve it, they send back this special search results page with suggestions of what you might be trying to find. Well, when I go to my local domain, I do not get this page from my ISP. I get the error mentioned above straight from edge.

So, it seems to me that Edge is resolving the domain correctly, otherwise it would have been sent off to my ISP's DNS.

So, I would think then that maybe Edge just can't connect to the local machine. But like I said, several of these local domains are working fine. Also, using 127.0.0.1 directly in Edge also works. It's just these couple of domain names giving me a problem. And only in Edge (all other browsers work) Any ideas?

The web server is Apache2 for Windows (xampp) if that matters.

Also, if I open the debug window in Edge and monitor the network, I do not see any requests going out at all.

EDIT: I am no longer using the hosts file. I have dnsmasq running on one of my Linux boxes and I am using it for DNS instead of hosts. Also no longer using loopback (obviously since DNS is on another box now), I am using an internal private ip address (192.168...). Same issue.

Evan de la Cruz
  • 1,912
  • 1
  • 12
  • 15
  • Pretty sure it has something to do with the Compatibility view settings similar to IE. I can switch it back and forth on IE. Not sure where the option is on edge. – Dipen Shah Sep 03 '15 at 20:21
  • I think you use this: https://www.microsoft.com/en-us/download/details.aspx?id=42501&WT.mc_id=rss_alldownloads_all , I am trying now to see if these domains are in the list for some reason... – Evan de la Cruz Sep 03 '15 at 20:40
  • Thanks for your help but I don't think this is it. I do not have any sites in my compatibility lists for IE or "Enterprise Mode" (Edge's compatibility system thingy) – Evan de la Cruz Sep 03 '15 at 21:14
  • Sorry really not sure then. – Dipen Shah Sep 03 '15 at 21:16
  • 2
    Just come across this problem myself. None of the fixes described here worked, but I opened Fiddler (HTTP debugger) and then it worked fine. So a workaround is to install Fiddler and always have it open when testing in Edge. But I'm not sure how Fiddler is making Edge work - if Edge doesn't normally send the request, then why would adding a proxy make it send the request? – Dave Kennard May 31 '16 at 10:15
  • Opening Fiddler was the only thing that worked for me. I also can't understand how that is possible, but I can live with opening Fiddler each time, so I'm finally moving on. Thanks Dave Kennard! – Holy Joe Feb 28 '17 at 23:20
  • Can someone confirm that it works with *any* proxy or if it is something special about fiddler? – Evan de la Cruz Mar 01 '17 at 19:55
  • Fiddler has the ability to exempt loopback blocking, allowing one's machine to communicate with itself. It's pitiful that a third-party application is necessary to have Microsoft's browser work with its own operating system. – Suncat2000 Jun 23 '17 at 11:53
  • I think this answer looks promising: https://stackoverflow.com/a/45102895/546833 – Evan de la Cruz Nov 16 '17 at 18:07
  • Still broken: does Microsoft not want any developer testing on their shiny IE replacement browser ???? – Andrew Nov 09 '18 at 15:58

10 Answers10

122
  • Your network can block loopback as a security measure in Windows 10.

  • Open a command prompt as administrator, and run this to exempt Edge from a loopback:

    CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"
    

(Microsoft.MicrosoftEdge_8wekyb3d8bbwe is the identifier for the Edge app)

There's a blog post here giving more detail: https://blogs.msdn.microsoft.com/msgulfcommunity/2015/07/01/how-to-debug-localhost-on-microsoft-edge/

Chris Halcrow
  • 21,541
  • 11
  • 115
  • 145
  • 14
    Where is that crazy identifier found/documented? – mlhDev Feb 27 '17 at 20:33
  • Its the name of the folder Edge is installed in, in you local packages folder. C:\Users\UserName\AppData\Local\Packages – Donny V. Mar 06 '17 at 15:31
  • @mlhDev Or using powershell command `Get-AppxPackage`. It's really odd, that the _Allow localhost loopback_ option in `about:flags` doesn't work in this situation and in some other similar to this (like localhost proxy for local addresses for example). But `CheckNetIsolation` works like a charm. – Vizor Apr 21 '17 at 14:53
  • 1
    This didn't work for me but having fiddler running did, which is odd. – Daniel Jackson Sep 13 '17 at 17:41
  • 2
    Works for me. I've found it documented in https://developer.microsoft.com/en-us/microsoft-edge/platform/faq/#how-can-i-debug-localhost – manavi Sep 18 '17 at 14:43
  • 8
    I sure love Microsoft, Windows, and IE/Edge. Every other browser worked just fine, but Edge needed some bizarre command-line script to be run. Can't say it doesn't surprise me. Thanks for sharing the answer and resources. – Jeff Jenkins Apr 24 '18 at 15:26
  • @Chris Halcrow I'm surprised I never commented on this answer as it clearly works for a lot of people. However, back when I was having the problem, this solution did not work for me. I think ultimately there are probably several variables that can cause of affect this issue. Worth noting that I no longer have the issue in 2018, but my configuration has changed in numerous ways over the years, so who knows. – Evan de la Cruz Jul 23 '18 at 20:36
  • 1
    @Chris Halcrow Ok I see I did mention this fix in another post down below. Basically what I said is that this fix seemed to work for a while, but then the behavior reverted. – Evan de la Cruz Jul 23 '18 at 20:40
  • Thanks Evan can you determine if it was related to a Windows version, a Windows update or any specific configuration? I don't think I've seen any recurrence of this in my own use that requires re-applying the fix. Does re-applying it work for you as a workaround? And for how long does it stay fixed? – Chris Halcrow Jul 23 '18 at 21:11
  • This solution appears to work only for entries in the hosts file that point to localhost (127.0.0.1), and not for any that point to a virtual guest on a different subnet, such as 192.168.x.x. For that configuration, see this other Answer, https://stackoverflow.com/a/42701618/1772379 (Fiddler seems to be the simplest of the options). – Ben Johnson Oct 23 '18 at 18:13
  • 1
    Another reason why I use Chrome to debug my software development. Get with the program Microsoft. – Dennis Kiesel Nov 13 '18 at 04:46
  • Genius! All hail the HypnoChris! – Julha Jun 09 '19 at 11:04
  • 1
    In my case I was finding the background script on my edge extension was failing on a fetch to localhost (error message: Failed to fetch). This fixed it for me. – soupy1976 Jun 14 '19 at 08:26
12

I (thought I) solved it!

Things that did not work:

  • Making changes to IE compatibility settings or Windows compatibility lists
  • Using fully qualified domain names
  • Using an IP address other than loopback
  • using http vs https
  • remove all javascript and cross-site scripts/resources from the web page
  • checking / unchecking the option in about:flags for allowing localhost loopback or using compatibility settings
  • removing / adding / editing the entries in the TabProcConfig of the Windows Registry
  • deleting browsing history, cache, cookies

The Solution: in a complete counter-intuitive twist:

Remove the domain names from your trusted sites list!

  1. Open the Internet Options dialog (just ask Cortana or use windowskey+s)
  2. Go to the Security tab
  3. Click on the Trusted Sites zone
  4. Click the Sites button
  5. Remove the troubled domain names from the trusted sites list
  6. Click Apply and then close the dialog
  7. Open Edge (or restart it if it is already running)
  8. Viola

I should note that I, using common-sense, figured that it wasn't just the fact that the site was merely present in the "Trusted Sites" zone that caused the issue. I figured it was some setting on that zone. So, before I deleted the domain names from the "sites" list, I made all of the settings match my Internet Zone settings exactly (Medium high security, enable protected mode, do not require server verification for all sites), and I also tried every other combination I could find. There was no combination of zone security settings that worked. The only solution was to simply remove the domains from the Trusted Sites list completely. Funny thing is that it works in IE regardless, even though this is the internet settings dialog for IE. This only seems to affect Edge.

Windows 10 Internet Options

Remove Trusted Sites from the Trusted Zone

EDIT: Two weeks later I change my configuration to, instead of the hosts file, use dnsmasq on a local Linux machine and using it for DNS. I'm not sure if it happened right away but at some point Edge stopped working again! I already had the "allow loopback" checkbox checked in about:flags, so I didn't expect the CheckNetIsolation fix to work. But, it did. Edge version is 20.10240.16384.0. I used the fix from Can't open localhost in Microsoft Edge (Project Spartan) in Windows 10 preview

EDIT #2 A couple of months later and Edge is having this problem again. I tried both previous solutions (and others) and neither of them work for me anymore. I'm leaving this answer because I am assuming I experienced two separate problems.

Community
  • 1
  • 1
Evan de la Cruz
  • 1,912
  • 1
  • 12
  • 15
  • I'm curious, if you enable (Enhanced) Protected Mode (see last screenshot) does IE behave just like Edge? We came across this same problem (and solution) in both browsers and in IE it was triggered by EPM. – nemec Oct 10 '15 at 18:30
  • I tried edge with and without protected mode without any difference. I'll try IE soon and report back. – Evan de la Cruz Oct 10 '15 at 20:24
  • Interesting. In my case (described in the 1st answer) adding the intranet domain to the Trusted Sites list via the Internet Options didn't help. I thought those settings do not apply to the Edge browser. But from your answer it is obvious that sometimes they do. – beluga Oct 13 '15 at 20:14
  • @nemec, the site loads in IE regardless of which settings I use. I should note though that is after I ran CheckNetIsolation as described in http://stackoverflow.com/questions/30334289/cant-open-localhost-in-microsoft-edge-project-spartan-in-windows-10-preview?rq=1 when I changed my configuration and Edge broke again. – Evan de la Cruz Oct 19 '15 at 17:19
  • @beluga In my case I had to *remove* the site from the list. I should also note that as of today Edge is broken again. That's why I'm here revisiting to try some other suggestions. – Evan de la Cruz Dec 17 '15 at 19:20
  • I unaccepted this answer because Edge is again having this problem and this fix no longer works for me. – Evan de la Cruz Dec 17 '15 at 19:34
  • 1
    Just like you linked, the solution `CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"` in an elevated command prompt fixes it. – Kevin Ghadyani Apr 18 '16 at 21:48
  • I'm just trying to access a local virtualbox guest with Edge and it is proving impossible. (access is fine for every other browser tested). I have tried the above suggestion, registry change recommendations, setting CheckNetIsolation - all with zero effect. There is a strange anomaly I see in Windows 10 with the Virtual box host adapter in that it displays 0 traffic, even when traffic is passing through it, so am not sure whether there is some VB adapter issue that is causing the problem. Anyway just thought I'd share here in case anyone else is tearing their hair out like I am. – Pancho Aug 01 '16 at 20:31
  • The solutions in this one worked for me. Adding the exact ip and port of the internal machine that I am trying to connect to worked. – Daniel Jackson Sep 13 '17 at 17:39
12

Edge doesn't support VPN IP addresses so any workaround needs to employ some sort of proxy. Here are some solutions that I found work:

  1. Install and run fiddler. Fiddler will basically intercept the request from the browser then forward it to the destination. This is the easiest workaround.

  2. Configure a proxy via the built-in Windows tool: netsh. The basic steps involve assigning your development domain to an available local private IP address in the 127.0.0.0/8 range, then mapping this IP to the webserver's IP on the VPN. See step by step instructions here

  3. Use the port forwarding feature of ssh to configure a proxy. Assuming that port 80 is available on localhost, add 127.0.0.1 d.somewebsite.com to your host file, then run the following ssh command: ssh -L localhost:80:localhost:80 user@devwebserver, where devwebserver is the hostname of your development webserver (say in the VM or vagrant instance, or across the VPN). This option assumes you have ssh access to the dev server.

Community
  • 1
  • 1
ttk
  • 375
  • 2
  • 3
  • 1
    I'm not using a VPN. What is a "VPN IP Address"? – Evan de la Cruz Mar 09 '17 at 17:49
  • 2
    fiddler was always a good friend, but I didn't expect him to save my ass in this case...I've been struggling with this for hours and this finally works...THANK YOU – makak Apr 26 '17 at 08:46
  • none of the given solutions worked for me, however fiddler did the job! just install it and fix microsoft problems! – undefinedman Sep 08 '17 at 15:13
  • WTF? I've been struggling to find the answer for why Edge won't work with a web server on an active directory domain and the only solution that worked was running Fiddler. I still don't understand what is going on? – Ryan Mortier Oct 02 '17 at 19:09
7

Your "remove from trusted sites" solution didn't work for me because my local sites were not on my trusted sites.

But you got me looking the Internet Options and I managed to get IIS working for local sites for me on Windows 10. This is what I did:

  1. Open Internet Options and select "Local intranet"

enter image description here

  1. Click on "Sites"

enter image description here

  1. Click on "Automatically detect intranet network"

enter image description here

  1. Click OK. Try your local machine site in Microsoft Edge and it should now work.
lkessler
  • 19,414
  • 31
  • 125
  • 196
4

May not apply to your situation, but nonetheless. My setup was as follows. A public space address (internet) page was attempting to load a page with a private space address (intranet) in an iframe and Edge would refuse to load the intranet page with the same "Hmm, we can't reach this page" message, and with "SEC7117 Error" in the debug console. Turns out Edge doesn't like mixing internet/intranet zones (see Understanding Enhanced Protected Mode blog post for reasons why). Edge runs tabs in separate AppContainers, and AppContainer network restrictions are sensitive to your network configuration.

My solution was to take the server which hosted the intranet page in question out of the domain network by assigning a second private space IP to it, and create a second DNS entry to that IP. The server ends up having 2 IPs: one on the domain network and an alternative one and 2 different DNS entries. Edge is then pointed to the alternative URL and it starts loading the intranet page just fine. It seems like as long as the IP masks of the PC and the page URL in question do not match, Edge will load the page.

The blog post I mentioned has info on Loopback-blocked for localhost and lack of privateNetworkClientServer capability in IE. As far as I can tell all that info applies to Edge.

beluga
  • 806
  • 7
  • 14
  • 2
    Definitely does not apply to my situation. My intranet page is being served from my local computer (in other words the client and server are the same machine). There is no iframe. There is no mixing of zones. I have a local page with the following public html document: `hello` My machine's name does not include a domain name (its not qualified). Also, I can get to several local sites using the host file. Just not this one. So, d.test1.com and d.test2.com both work but this one, t.test3.com, does not work. It works fine in other browsers. – Evan de la Cruz Oct 10 '15 at 07:21
  • The link to the blog post is broken. It appears to have been pointing to [this post](https://blogs.msdn.microsoft.com/ieinternals/2012/03/23/understanding-enhanced-protected-mode/). – Addison Schuhardt Aug 01 '18 at 21:45
3

When this happens to me I can find a domain entry in the registry key below that matches the domain. When I remove it things work, for a while... I don't know why but Edge will add it back eventually.

Computer\HKEY_USERS\S-1-5-21-964789662-521690395-1734141374-1111\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\TabProcConfig

Brian
  • 347
  • 1
  • 3
  • 11
  • This was my problem too. Anyone any ideas why? – Neromancer Jul 23 '18 at 10:25
  • No idea why, but I used powershell to remove and reinstall Edge and I'm no longer experiencing the issue. A quick Bingle for how to do this found this site: https://www.cnet.com/how-to/how-to-reinstall-default-apps-in-windows-10/. You might try that... – Brian Jul 24 '18 at 18:21
  • 1
    Can't find `TabProcConfig` under that path (for the current user, the user specified does not exist). – Qtax Oct 14 '18 at 19:25
  • Removing my site from TabProcConfig worked for me. But I had to remove it from Trusted Sites, too (where I added it before, because another tip said so) – user2543253 Jan 24 '19 at 15:33
3

Noting from your edit that you are now accessing the site on 192.168.0.0/16 address, rather than on 127.0.0.1, I am guessing you are running into an issue with the way the Edge browser behaves differently depending on the interface used to access the site. Other browsers I tried don't behave this way.

In my environment, I had a Virtualbox host-only network setup and this had an NdisDeviceType of 1. Edge would only allow me to navigate to sites over this interface after I changed NdisDeviceType to 0. The registry key you need is:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\XXXX

Instead of XXXX, you need the correct key for your interface, which I determined from "route print" and subtracted 1. For me it was "0016".

The value to change is called *NdisDeviceType. (That's a literal asterisk.) I changed it from 0 to 1 and had to reboot for Windows to notice the change.

My answer was gleaned from a post by "Jani L" dated Oct 3, 2017. I also posted this solution in more detail to another stackoverflow question. Also see a Virtualbox ticket 15565.

rohanc
  • 385
  • 3
  • 8
2

None of the other solutions worked for me. It turns out that my issue relates to VPN. Microsoft Edge still doesn't support VPN IP addresses, while Internet Explorer 11 does. Impressive that this is still an issue as of May 2016.

Additional Details: https://social.technet.microsoft.com/Forums/en-US/b3a687ae-345d-4c3f-9070-184b33fb1fc6/microsoft-edge-cant-access-vpn-ip-address-but-ie-11-can?forum=win10itprogeneral

Currently Microsoft Edge seems to be not working well with VPN. And the mechanism to connect to Internet from Microsoft Edge is a little different from Internet Explorer 11 and the other desktop browsers, which I can't explain clearly as I don't know much about it.

So based on the current situation, please take use of Internet Explorer 11 instead.

Pang
  • 8,605
  • 144
  • 77
  • 113
Vika
  • 41
  • 5
2

In my case changing the network type from private to public did the trick. This is also reproducible and changing the network type reliable changes the state from "working" to getting: Http failure response for (unknown url): 0 Unknown Error

Aros
  • 188
  • 1
  • 12
  • Can you provide the steps for changing the network type on Windows 10 home (wired ethernet)? I can't seem to find the radio buttons I'm expecting. The closest I can find are the network sharing options with different choices for *private* or *public*, which don't seem quite right to me. – Evan de la Cruz May 29 '18 at 20:11
  • 1. Click WiFi icon in system tray; 2. click properties on your network; 3. change network profile from Private to Public. https://tinkertry.com/how-to-change-windows-10-network-type-from-public-to-private – Mark Leong Aug 23 '18 at 03:42
0

For me, I went to Internet Options (control panel), then Security, then selected local intranet and then put a tick in the "Automatically detect intranet network". This greyed out the nested options below, and Edge immediately started using my hosts file.

frumbert
  • 2,014
  • 4
  • 25
  • 55