In fixing my admittedly somewhat custom setup on my Ubuntu 12.04 workstation, when I connect the VPN connection, the DNS server of it is added to the bottom of /etc/resolv.conf instead of the top, resulting in all DNS queries intended towards the VPN destination to fail (because the first DNS server on this list responds negatively to the queries and my computer never asks the bottom DNS server to provide it's answer).
If I edit /etc/resolv.conf by hand and simply move the nameserver record that Network Manager adds there to the top, it works fine. But this workaround is obviously not preferred.
I should probably mention I turned off dnsmasq because with it, the VPN's DNS resolution does not work at all, despite all the files containing what they should have.
What is the proper way to fix this?