I'm running Ubuntu 20.04.3 LTS.
After booting, and before connecting to my VPN, my /etc/resolv.conf
looks like this:
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0 trust-ad
It gets changed when I connect to my VPN and looks like this:
# Perimeter81 Custom DNS
nameserver 10.127.248.1
But then when I disconnect from the VPN, it doesn't get regenerated properly, it ends up with just a comment in it:
# Generated by resolvconf
...and of course then lookups don't work. I have to disconnect/reconnect from my wifi, and then it goes back to what it was originally.
So it seems like whatever is triggered on VPN disconnect to regenerate resolv.conf is doing something different than whatever sets it up in the first place. How do I fix it?