1

I'm currently having a very restrictive internet access, basicly, anything that doesn't use port 22, 443 or 80 are routed through a different network who has a 1 seconde ping and 60% packet loss. Since I need to use a lot of software that use different port, I've setup an OpenVPN server wich use tcp on port 443.

Everything works fine except for one thing : The server who host the OpenVPN server also host my web server, and, has a client, I need to access it via it's domain name on port 8080 (so http://domain.com:8080 for example). For some reason, when I do that, instead of being routed through my VPN like every other request, I get routed via the very slow network.

So, is there a way to specify to my OpenVPN client that domain.com is on 10.8.0.1 (virtual ip of the OpenVPN/WebServer) instead of requesting the "true" ip to a DNS ?

Maeln
  • 113
  • 3

1 Answers1

0

Add an entry to /etc/hosts

10.8.0.1      domain.com
atsa
  • 61
  • 3
  • I can do that, but I have many client, some on linux, some on windows and not always using the VPN ( so 10.8.0.1 domain.com would be failing ), so I was wondering if there was a way to "force" that route onto the client when he use the VPN. – Maeln Oct 25 '14 at 18:45
  • You might want to push dns servers through Openvpn server and on clients use up/down scripts to update dns servers. Not what happens to windows clients but the below link has a script for linux users : [link](https://raw.githubusercontent.com/masterkorp/openvpn-update-resolv-conf/master/update-resolv-conf.sh) This means that internal dns will have domain.com point to the interal ip and when user is not connected to the vpn it will query the dns they had configured before. – atsa Oct 25 '14 at 18:57