When you connect to openvpn from network manager. it does not encrypt dns requests through vpn, the result is that ubuntu uses local goverment dns results.
If you have set up your own VPN, you can modify the following line in the openvpn configuration file.
push "redirect-gateway def1 bypass-dhcp bypass-dns"
Change that to
push "redirect-gateway def1 bypass-dhcp"
and change the default configuration:
push "dhcp-option DNS 184.108.40.206" push "dhcp-option DNS 220.127.116.11"
push "dhcp-option DNS 10.8.0.1"
Assuming 10.8.0.1 is the gateway you setup for your vpn clients. Note: Normally you don't want DHCP to go over VPN, if you do, remove the bypass-dhcp also.
Also make sure your server can handle the traffic by adding the following to the firewall rules.
iptables -v -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
If those doesn't fix not your problem, then you need to look at your routing table on your client side to ensure that the gateway route over 10.8.0.1 has lower metric over the gateway configured on client machine (typically 18.104.22.168 or something). You can modify increase the non-vpn gateway to a higher number, lower metric have higher routing priority.
On your client machine after connected to the VPN, check the routing metric.
ip route default via 10.8.0.1 dev tun0 proto static metric 50 default via 192.168.0.1 dev enx00 proto dhcp metric 100 default via 192.168.0.1 dev wlps proto dhcp metric 600 10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.4 metric 50 100.77.34.23 via 192.168.0.1 dev enx00 proto static metric 100 ....
As you can see, 10.8.0.1 tunnel have the lowest metric and hence will be tried first. The 192.168.0.1 of the local ISP on ethernet interface will be tried next, and so on.