I am running Ubuntu 22.04I have an OpenVPN to my company via NetworkManager in gnome.
Most of the interal systems work, but for example portal.azure.com has 2 DNS records, a public and private zone one. And when I am on the VPN, it should use the private zone, otherwise I am blocked by the firewall and can't see anything.
I removed the /etc/resolve.conf symlink to fallback to the default behavior, and when I connect, I see the nameservers of the company added to the bottom
nameserver 89.xxx.xxx.xxxnameserver 89.xxx.xxx.xxx# Too many DNS servers configured, the following entries may be ignored.search home company.xx nameserver 10.xx.xx.xxnameserver 10.xx.xx.xx
This doesn't give me access to the private stuff in portal.azure.com
When I swap the nameservers, then it does work:
search home company.xx nameserver 10.xx.xx.xxnameserver 10.xx.xx.xxnameserver 89.xxx.xxx.xxxnameserver 89.xxx.xxx.xxx
What can I do to make this work automatically, or via systemd-resolved.
If I open /run/NetworkManager/no-stub-resolv.conf
then I do see the correct file for /etc/resolv.conf:
# Generated by NetworkManagersearch company.xx homenameserver 10.xx.xx.xxnameserver 10.xx.xx.xxnameserver 89.xx.xx.xx# NOTE: the libc resolver may not support more than 3 nameservers.# The nameservers listed below may not be recognized.nameserver 89.xx.xx.xx
I could replace the /etc/resolv.conf with the NetworkManager version, but it seems this should be done automatically. How can I fix this?