I have set up a VPN. I have a web app running on Apache and I changed configuration files only to allow connections from 10.8.0.0/24 subnet. My goal was to distinguish connection made from inside of VPN and from outside.
So I set up DNS inside my VPN. I wanted following behavior: When I'm connected to VPN and I enter app.domain.com into the browser, my private DNS will resolve domain name app.domain.com to private IP inside VPN e.g. 10.8.0.10. But when I'm not connected to VPN and I enter app.domain.com into the browser, my ISP's DNS will resolve domain name app.domain.com to public IP, e.g. 100.100.100.100. For VPN I use OpenVPN and I used configuration directive dhcp-option DNS 10.8.0.1 to push DNS to clients.
On my client computer (Windows 7) it works like a charm. When I'm connected to VPN, private DNS will resolve domain name to private IP. When I'm not connected to VPN, public DNS will resolve domain name to public IP. But on my friend's computer (again Windows 7) when he's connected to VPN he still gets public IP when he try to resolve domain name app.domain.com. I checked his ipconfig /all output, on his virtual VPN adapter is correctly set up private DNS 10.8.0.1.
So I wonder: Is there any DNS priority, so private DNS will be prioritized over public DNS ? Can I somehow attain behavior I mentioned earlier ?
Thank you for your answers