Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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: 192.168.101.0/24
  • Router address: 192.168.101.1

Home LAN:

  • Address space: 192.168.1.0/24
  • Router address: 192.168.1.1

VPN:

  • Address space: 10.100.1.0/24
  • OpenVPN server address: 10.100.1.1

All machines are running Microsoft Windows.

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

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

share|improve this question

3 Answers 3

up vote 14 down vote accepted

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"    
share|improve this answer
    
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 at 13:01

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).

share|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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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