vpn-user
I have two subnets - 192.168.0.0/24 and 10.0.1.0/24. And each of the networks have local DNS servers to resolve the hostnames.
I have established an openvpn connection with the subnet 10.8.0.1/24 and openvpn clients connected from the two subnets.
The server configuration server.conf has the options,
push "redirect-gateway def1"
push "dhcp-option DNS 10.8.0.1"
If the redirect-gateway def1 is used then, at client-side I cannot resolve hostnames to IPs (internal hostnames basically DNS queries fail), but I can ping public IPs e.g. Google's DNS server.
I also have the below iptable rule on the server side,
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
I am using the OpenVpn server to be the DNS server address for the clients, but not sure how to link between the openvpn dhcp and the dnsmasq running on the OpenVpn Server so as to update the /etc/hosts file and resolve the hostnames between the .
Please let me know how to resolve the hostnames over openvpn in a network and also between the two networks.
Thanks