My setup consists of a client and a server where the client is connected to the server using OpenVPN. It's configured to route all traffic through the tunnel. This works well, the ip is the server ip and traceroute shows that the traffic is routed through the servers network.
There's one exception though, when connecting to a domain pointing to the same server, the traffic is routed outside the VPN tunnel, i.e. the server shows the clients real ip and traceroute shows the traffic being routed through the clients ISP.
My wish is to route all traffic through the the tunnel, even traffic which ends up on the server and it is necessary to use the domain name instead of the servers local ip. Any ideas?
The server is running Windows 10 and the issue appears on clients when using OpenVPN on Windows 10, Linux and OpenVPN Connect on iOS. The issue is NOT present when using OpenVPN Connect on Android. It would be interesting to understand why it works on Android as well.
Here's my server config:
port 1194
proto udp4
dev tun
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\server.crt"
key "C:\\Program Files\\OpenVPN\\config\\server.key"
dh "C:\\Program Files\\OpenVPN\\config\\dh2048.pem"
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist "C:\\Program Files\\OpenVPN\\log\\ipp.txt" 5
client-config-dir "C:\\Program Files\\OpenVPN\\config\\ccd"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "route 255.255.255.0"
duplicate-cn
keepalive 10 120
cipher AES-256-CBC
persist-key
persist-tun
explicit-exit-notify 1
And client config:
client
dev tun_c_ovpn
proto udp4
remote <address> 1194
resolv-retry infinite
keepalive 5 10
nobind
persist-key
persist-tun
cipher AES-256-CBC