Universal practice is editing the resolv.conf file and then write-protecting it with.
chattr +i /etc/resolv.conf
This always works, but certain applications NetworkManager have their own preferred way of doing things that I quite frankly do not care to learn.