If you’re running Ubuntu 16.10 or later, your DNS resolution will be managed by the systemd-resolved service.
You can disable this service without any further ado using the following commands.
systemctl disable --now systemd-resolved.service rm /etc/resolv.conf
See Opting-out of NetworkManager, as it may step in automatically to handle the resolv.conf file after you remove it.