LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Resolve VPN client hostnames using Bind (http://www.linuxquestions.org/questions/linux-server-73/resolve-vpn-client-hostnames-using-bind-4175434399/)

Jodel 10-27-2012 03:46 PM

Resolve VPN client hostnames using Bind
 
I have a number of VPN clients connecting to a Ubuntu 12.04 server (This was set up using Zentyal 3.0). I need to connect many more.
I would like to be able to address the clients from the server by hostname.
The Openvpn server gives all the clients IPs in the 196.168.160.0/24 range. The Server running Openvpn has a 192.168.1.20 address.
The DNS server is up and running but it does not resolve the host names of the clients on the VPN.

How can I set up the DNS on the server so that I can ping, ssh etc., and connect to the Clients by hostname, from the server, rather than by IP address.
Thanks,
Jodel

foodown 10-27-2012 08:34 PM

Do you just want to be able to use generic names like 'host001', 'host002', etc, or do you want specific host names for each machine? The later is not going to be possible unless you're assigning the same IP to the same machine every time.

Are you asking how to set up BIND in general or something more specialized to this situation? Please clarify.

Jodel 10-28-2012 03:45 AM

Thanks for your reply. I have Bind set up and working as a caching dns server for all the machines on the local net 192.168.0/24.
The external machines that connect via Openvpn are all linux machines with hostnames.
They connect to Openvpn, but the same machine could come from a different external ip each time it connects
Openpenvpn assigns them ip numbers. 192.168.160.2, 3, 4, 5, etc on the basis of order of connection and next available number. As the external could be .5 the first connection and .7 the next time, is there any way of linking the actual host name of the external machine to the ip allocated by Bind such that I can for example ssh to the client from the server on the basis of the clients host name?
Hope I have made the question clearer?
Jodel

Jodel 10-28-2012 04:10 AM

Just another thought. If Ovenvpn could allocate the same ip each time to the same connection name this would resolve the problem. Can that be done?
Jodel

foodown 10-28-2012 02:44 PM

Quote:

Originally Posted by Jodel (Post 4816562)
Just another thought. If Ovenvpn could allocate the same ip each time to the same connection name this would resolve the problem. Can that be done?
Jodel


http://openvpn.net/index.php/open-so...to.html#policy

It gets a little complicated, but OpenVPN can do this.

You'll identify each machine though the way it authenticates, since they could be coming from different IP addresses at different times.

Once the IPs are only being assigned to specific machines, you can set up a zone file for the subnet and have your desired result. (Don't forget reverse DNS.)

Jodel 10-28-2012 06:50 PM

Thanks for that. I will try that approach.
Jodel


All times are GMT -5. The time now is 07:31 PM.