Access Website from VPN connection only

vpnwebsites

I have a Mac Mini Server with Open Directory, File Sharing/WebDAV, VPN, and Website services running.

I can view files from my Mac on my iPad remotely when connected to my VPN. I can also view my website locally. I did not port forward port 80 on my router.

However, I have since requested a static IP with my ISP and purchased a domain name. I have the domain name A record pointed to my IP address.

How can I view my website hosted on my Mac by using my domain name ONLY when I'm connected through VPN? I don't want anyone going to mydomain.com and seeing my site unless they are joined to my VPN.

Right now I can type in the local IP to see the site, but I prefer to use my domain name instead.

Best Answer

Because you want to be able to access the domain only from your local network (which includes the VPN) then you didn't need to get the static IP or domain name. Those are only needed if you want to allow a user to connect from outside the network. For your purpose you just need to set up a domain on your intranet and I found a tutorial at http://www.edugeek.net/forums/internet-related-filtering-firewall/111965-domain-name-intranet-use.html that should work. If it doesn't work then you will be stuck with using the IP Address and out however much you spent on the domain and static IP. However on the bright side you are smart enough not to open up port 80 to the rest of the internet. Good luck!