As a workaround, I placed the following script in /etc/NetworkManager/dispatcher.d/02-vpnupdown location. It will restart systemd-resolved service everytime you bring up a vpn connection allowing to use as current dns the one provided by the vpn. I tried to send a SIGRTMIN+1 signal to systemd-resolve to flush dns server but it randomly have the desired effect by cli but never by a script triggered by a vpn-up event from network-manager. On vpn-down event, dns configuration is fine so I won't restart the service to avoid restarting it too often.
Hope this will help someone while this issue is being fixed.
#!/bin/bash
STATUS=$2
case "$STATUS" in
'vpn-up') systemctl restart systemd-resolved;;
esac
As a workaround, I placed the following script in /etc/NetworkMan ager/dispatcher .d/02-vpnupdown location. It will restart systemd-resolved service everytime you bring up a vpn connection allowing to use as current dns the one provided by the vpn. I tried to send a SIGRTMIN+1 signal to systemd-resolve to flush dns server but it randomly have the desired effect by cli but never by a script triggered by a vpn-up event from network-manager. On vpn-down event, dns configuration is fine so I won't restart the service to avoid restarting it too often.
Hope this will help someone while this issue is being fixed.
#!/bin/bash
STATUS=$2
case "$STATUS" in
'vpn-up') systemctl restart systemd-resolved;;
esac