I develop my websites using Linux in a VMWare Virtual Machine, on a Windows host PC. I have the VM configured to use NAT for the Network connection, which means that the VM does not have its own specific IP address on the network, but rather shares the host machine’s IP address.
This is no problem for testing sites locally from the host machine (on a linux VM use ifconfig
to get the IP address, then add this with your test domains to the host machine’s hosts file). However, it does cause issues if you want to test your sites from other machines on the network, as they have no way of connecting to your VM. In my case I had a Windows tablet that I wanted to test my site on.
Thankfully Fiddler can come to the rescue. On your host PC you need to have Fiddler act as a proxy and allow remote computers to connect checked. After setting this, you’ll need to restart Fiddler.
On your computer you want to test the site on, you also need Fiddler installed. On Fiddler’s menu go to Tools > HOSTS.... In the Host Remapping window that pops up, check the Enable remapping of requests for one host to a different host or IP, overriding DNS. option.
In the text area, add the IP address of your host machine (use ipconfig
on the host machine to get this), followed by the port Fiddler on the host machine is listening on. Then a space, followed by the domain you want requests to be redirected for. Then hit the save button.
You should now be able to successfully test your site. On the test machine, Fiddler intercepts the request and sends it to Fiddler on your host machine. That then follows your windows hosts file and will send the request on to your VM. Which can then handle the request and respond with your test site.