Openvpn: how to get clients to use network names available on server

openvpn

I have an OpenVPN server at 10.8.0.1, with client-to-client and static addresses being given out to certain clients via ifconfig-push.

the server's /etc/hosts has things like

bobs_server 10.8.0.100
jims_server 10.8.0.105

Is it possible to configure the server so that when clients log into the VPN they can use the same network names as the server?

It is not a good solution here to set such addresses in the client's /etc/hosts.

Best Answer

Is it possible to configure the server so that when clients log into the VPN they can use the same network names as the server?

No, hosts files are typically for local resolution only. If you need to provide name resolution services to clients, you'll need to set up a proper DNS server.

Dnsmasq is a relatively simple, low-footprint option that is simple to configure. It can be configured to read its configuration from the server's /etc/hosts file.

It is a good solution here to set such addresses in the client's /etc/hosts.

No, it is never a good idea to do this outside of very short-term things.