I have set up an OpenVPN Server on a Debian9 device so that my company can reach our server infrastructure from the outside. I'd like them to use hostnames to reach the servers so I've set up Bind9 as an internal DNS. I've modified OpenVPN's server.conf so that the DNS and Domain are pushed to client :

push "dhcp-option DNS X.X.X.X"
push "dhcp-option DOMAIN mydomain.com"

I have no problems pinging hostnames and FQDN on a Linux client, however, on Windows, I can only ping the FQDN. If I do a ipconfig /all on the Windows client, I can see that the DNS suffix mydomain.com is affected to the right NIC. Running a nslookup shows me that the DNS in use is my computer's default and not the one provided by the OpenVPN server so my guess is that my computer only searches the hostname on the default DNS.


Which client version are you using ? The options available vary depending on the version as you can see here: OpenVPN - Using DNS servers pushed to clients

This is just a hunch but I would try adding this option in the client config file: register-dns (source)

Optionally: block-outside-dns (used to prevent DNS leaks)

  • I use the OpenVPN GUI. I don't know if register-dns changed anything but the block-outside-dns solved the problem apparently ! Thanks ! – Ror Mar 3 '20 at 8:11
  • I might have been to quick to mark this as solved. block-outside-dns blocked DNS server on other interfaces. It worked since my private DNS allowed recursion. I want to block this so that my private DNS only communicates inside our LAN. Windows clients can't use internet then because they are asking the private DNS to resolve names. I decided to investigate the register-dns option. with wireshark, I can see that the Windows client ask the private DNS to resolve servers hostnames and the public DNS to resolve internet names but a ping still tries to resolve every names with the public DNS – Ror Mar 4 '20 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.