I'm using OpenVPN to set up a VPN to connect my laptop at home to my workplace LAN. I want to be able to refer my workplace computers by their name and not by their IP but I can't.

This is my situation:

Workplace LAN:

  • Address space:
  • Router address:

Home LAN:

  • Address space:
  • Router address:


  • Address space:
  • OpenVPN server address:

All machines are running Microsoft Windows.

At my workplace, the PC running as the OpenVPN server is (and in the VPN), and its machine name is workplaceserver.

At my workplace the name workplaceserver is resolved to address, but in the vpn client the name workplaceserver can't be resolved, I want it to be resolved to How should I configure OpenVPN in order to achieve that?


You can use your office DNS (if you have one), instead if the default DNS you are using. To do so, you have to add this option to OpenVPN server (see docs)

push "dhcp-option DNS 10.x.x.x"    
| improve this answer | |
  • 2
    This doesn't seem to have any effect in my case. Could it be because I'm not using DHCP? I must use a static setup, but I'd like the DNS to get overridden anyway. – Daniel F Nov 6 '14 at 13:01
  • You may also need the redirect-gateway directive (see manual), since your default gateway has probably been handed to you by your DHCP or manually. Using the redirect-gateway sends things through the VPN - maybe fixing your issue in the process. – MrMajestyk Feb 3 '15 at 9:14
  • If you're not using a bridged network you will also need a route to the DNS server: push "route" – wilsotc Sep 13 '15 at 16:13

You can also simply add hosts you need (very few, isn't it?) to hosts file, and not even mess with OpenVPN configs (which may be useful if you don't have and won't set up DNS server inside the private network).

| improve this answer | |
  • Open an account at OpenDNS.
  • Create yourself a Network.
  • Add the IP range(s) of both sides.
  • Add workplaceserver as an alias.

From there, you should have it to work and your configuration will follow you, as long as you use their DNS, which are very good by the way.

| improve this answer | |
  • 7
    And make public your topology, not a good idea... – Kartoch Jul 26 '11 at 7:58

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.