I have a number of networks in remote locations, which I want to be able to access over a VPN. The topology of each network is simply a NAT router, and a machine running an SSH server. The router has the SSH port forwarded, so all that's needed is to be able to access the router's IP. I've configured an OpenVPN server, and set up the routers on each remote network to access it. The client PC is also configured to access the VPN, and the server has been configured so it can access the various routers by using their VPN IP addresses.
This all works great, except the VPN IP addresses of the routers are unknown to the client. Currently, I must look at the OpenVPN status log, then use that IP. I'd rather not use static IPs, as the number of remote networks will grow.
So, my question is, is it possible to run a local DNS server on the VPN server, and have it automatically be updated for the clients that connect?
I have seen several articles surrounding updating resolv.conf on the VPN server, as well as pushing DNS details to clients, but am unsure of the missing piece of actually running and updating a DNS server.
port 1194 proto udp dev tun ca ca.crt cert cert.crt key key.key # This file should be kept secret dh dh2048.pem server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt client-to-client keepalive 10 120 cipher AES-256-CBC comp-lzo user nobody group nogroup persist-key persist-tun status openvpn-status.log verb 3