In ubuntu /etc/resolv.conf is automatically generated by systemd. Do not edit this file. To add a new nameserver update the file: /etc/netplan/00-installer-config.yaml
dig yahoo.com
dig: parse of /etc/resolv.conf failed
Run the following commands fixed the parse error:
sudo rm /etc/resolv.conf
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo systemctl restart resolvconf