title: DNS redirect based on local or remote network connection
body: <p>I have a domain name mysite.com pointed to my dedicated server (debian 7).
  Authenticated users will be behind OpenVPN with local addresses and masquerading.</p>
  
  <p>What I want to do is send unauthenticated users to the server's remote ip and authenticated users to the local ip. To make things even more interesting, I have a reverse proxy setup to send a sub domain to a different port.</p>
  
  <p>So far I have looked at iptables prerouting, and apache2 proxy.</p>
  
  <p>The basic idea is if the user can reach 10.8.0.1 the domain mysite.com should resolve to 10.8.0.1 otherwise is should resolve to the remote ip. How can I achieve this?</p>