I have a remote OpenVPN server on a DD-WRT to which I'm connecting from a macOS based laptop with Tunnelblick. The server network is 192.168.0.0/24 and the client one is 192.168.1.0/24. On both the server and client routers I have set some aliases in the hosts file, in order to access nodes more quickly. These aliases work fine on both sides, and I have put the following options in the server conf file so the clients will use it as their DNS server when they are connected to the VPN :
Code: Select all
push "dhcp-option DNS 192.168.0.2"
push "dhcp-option DOMAIN lan"
Code: Select all
dhcp-option DNS 192.168.1.1
Code: Select all
ping: cannot resolve my_alias: Unknown host
This seems to be more due to the way the DNS entries are used than the way my setup is configured, but I don't face this problem with a Windows client, since the tun interface seems to get its own DNS entry (the VPN server's IP that's been pushed). Then the client seems to use both the real and tun interface and therefore manages to reach both DNS servers and use all the aliases. That doesn't seem to be the case under macOS.
I've spent hours looking for a way to fix this, without success. I didn't even managed to find any similar case, even though this seems to me like a pretty important use case.
Is there a way to configure OpenVPN so that this works ? Or maybe I'm completely missing something here.
Below are the server and client confs :
Server conf
port 1194
proto udp
dev tun
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
dh /tmp/openvpn/dh.pem
tls-auth /tmp/openvpn/ta.key 0
server 10.8.1.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
cipher AES-256-CBC
comp-lzo
persist-key
persist-tun
log-append /var/log/openvpn
verb 3
management localhost 5001
push "route 192.168.0.0 255.255.255.0"
push "dhcp-option DNS 192.168.0.2"
push "dhcp-option DOMAIN lan"
proto udp
dev tun
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
dh /tmp/openvpn/dh.pem
tls-auth /tmp/openvpn/ta.key 0
server 10.8.1.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
cipher AES-256-CBC
comp-lzo
persist-key
persist-tun
log-append /var/log/openvpn
verb 3
management localhost 5001
push "route 192.168.0.0 255.255.255.0"
push "dhcp-option DNS 192.168.0.2"
push "dhcp-option DOMAIN lan"
Client conf
client
proto udp
dev tun
remote my_remote_domain 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca ca.crt
cert Me.crt
key Me.key
tls-auth ta.key 1
cipher AES-256-CBC
comp-lzo
verb 3
proto udp
dev tun
remote my_remote_domain 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca ca.crt
cert Me.crt
key Me.key
tls-auth ta.key 1
cipher AES-256-CBC
comp-lzo
verb 3
Thanks
Scentle5S