I've been struggling with this exact issue for 2 days before finding the solution that worked for me here:
$ cd /etc/NetworkManager/system-connections
This is where connections created with the Network Manager are stored.
$ sudo nmcli connection modify <vpn-connection-name> ipv4.dns-priority -42
Simple command to modify the connection config file. Could be done manually as well but this way I believe is easier.
$ sudo service network-manager restart
Make the changes apply to your system.
Basically copy pasted from the link above, credit to original author.
If your system doesn't know nmcli, or adding connections using the Network Manager GUI throws an error, I recommend this link
Now for what's less of an explanation and more of a comment (rather clueless myself).
I tried many of the solutions including resolv.conf, dnsmasq and dnscrypt, all of which lead to my internet being blocked either entirely or when the vpn connection was turned off. None of them solved the dns leak, according to dnsleaktest.com.
If any of these are attempted, each step along the way should be tracked as to be able to reverse them in case of an undesired outcome. It took me no short amount of time to fix my broken internet time and time again without, guess what, internet. I am not claiming that these solutions do not work period, I very possibly made some mistake somewhere.
The solution I linked to however has the imho huge advantage that it does not mess with general network settings, but just with the one connection you're modifying.
Next, block-outside-dns, as mentioned in here before, is a windows only solution and threw some sort of not recognized option error on my ubuntu system.
Using ovpn cli commands did not solve the leak either for me.
The link I provided mentions an explanation (here) about some version inconsistencies that are fixed in ubuntu 18.10, maybe someone with more expertise on this topic cares to explain further. If that's true, LTS users will have to wait for april next year afaik.
Lastly I want to point out that for residents of countries with internet censorship, dns leak poses a heavy issue because allowing the local isp access to your traffic can and will lead to censored domains being blocked despite being connected to a vpn. So for future visits to china etc., this is something you want to take care of beforehand.
Hope this helps.