# Stop NetworkManager from overwriting resolv.conf
When using wireguard on ubuntu it needs to have `openresolv` installed instead of `resolvconf`. With this it can reset `/etc/resolv.conf` after connecting successfully.
We need to tell NetworkManager to also use openresolvs’ resolvconf, so that it does not overwrite the `/etc/resolv.conf` on any network changes (e.g. WLAN reconnect).
```
# Install openresolv
apt install openresolv
# Create file /etc/NetworkManager/conf.d/rc-manager.conf
echo -e "[main]\nrc-manager=resolvconf" | tee /etc/NetworkManager/conf.d/rc-manager.conf
# Restart NetworkManager
service NetworkManager restart
```
Source:
* [Broken DNS resolution](https://wiki.archlinux.org/title/WireGuard#Troubleshooting) which links to: [Use openresolv](https://wiki.archlinux.org/title/NetworkManager#Use_openresolv)