Install resolvconf
sudo apt install resolvconf
Edit the base file with what you want to always be in the file
sudo nano /etc/resolvconf/resolv.conf.d/base
Have resolvconf rebuild the base
sudo resolvconf -u
Here is a bash script I use to update DDNS with CloudFlare, I could use ddclient, but I like this it works for me
apt -y install dnsutils jq curl
#!/usr/bin/env bash # A bash script to update a Cloudflare DNS A record with the external IP of the source machine # Used to provide DDNS service for my home # Needs the DNS record pre-creating on Cloudflare ## Based on https://gist.