I run my own server at home, and host my site on it. The WHS software provides a subdomain on the homeserver.com domain. Browsing this domain from within my network has always caused problems – essentially, my browser ends up showing me my router’s configuration page.
Why is this happening? Because DNS lookup of my domain returns my public IP, which takes me to my router. If I were outside of my network looking in, my router would happily forward port 80 requests to the private IP address of my server. But without proper configuration, port forwarding only works for packets coming into my network. Packets originating inside my network don’t get processed by port forwarding rules, thus leaving me at my router’s configuration page.
The workaround for this problem is an easy one – I simply edit my computer’s hosts file (Windows 7 hides this file at C:\Windows\System32\drivers\etc\hosts) and add an entry for my homeserver.com subdomain with the private IP address of my server. While a bit hack-ish, this was a perfectly suitable solution for me – up until now.
With the introduction of jkshay.com (and it’s corresponding mail server), I needed a real fix. You see, my Android powered smartphone was unable to retrieve e-mail from jkshay.com while I was connected to my home network. Of course, I could simply disconnect from my wireless network, but I didn’t want to have to do that just to check my e-mail. If I rooted my phone, I could probably perform the same hack on the hosts file – but my phone isn’t rooted. I needed a way to be able to access jkshay.com from within my network without editing a hosts file.
After confirming that I wanted to proceed, I clicked the DNS Server section,..
and added an entry for jkshay.com pointing to my router’s private IP address.
I saved my changes, ensured that my computer was receiving its DNS settings from the router, removed my hosts file entry, and voila! – I could now browse to jkshay.com from within my network successfully!
A quick check of my mail on my smartphone confirmed that I had successfully configured NAT loopback on my FiOS router.