I am running an OpenVPN server on a Windows 10 machine with following server configurations:
port 1194 proto tcp dev tun ****ca/cert/key/dh/tls-auth omitted**** server 10.8.1.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "route 10.1.1.0 255.255.255.0" push "dhcp-option DNS 10.1.1.1" duplicate-cn keepalive 10 120 cipher AES-128-CBC persist-key persist-tun status openvpn-status.log verb 3 Say this machine as PC1 (10.1.1.2) and it is not the gateway for my LAN (10.1.1.0/24); there is a wireless router running as the gateway (10.1.1.1).
Remote client (another Windows 10 machine) can ping PC1 using the local IP address (10.1.1.2) but unable to ping using the hostname (e.g., mydesktop).
I can update client's Windows host file with the hostname, but if there are many clients this would not be very feasible.
I tried adding push "dhcp-option DOMAIN local" to sever.ovpn but it didn't help. I also tried adding a static DNS record to the router, but when client PING mydesktop, it gives this error: Ping request could not find host mydesktop. Please check the name and try again.
block-outside-dnsin the client conf to prevent DNS leak.nslookup mydesktopget resolved in both server and client. Butping mydesktopreturns the mentioned error message for the client.block-outside-dnson the clients then. I actually had similar problem: community.openvpn.net/openvpn/ticket/910block-outside-dnsdid not help me with my case. :(