/etc/resolv.conf defines the DNS server for the whole system, and it’s regenerated every time one new connection is setup by NM. The situation becomes a bit different with the advent of dnsmasq. dnsmasq is used by default by NM, with the default configuration:

# /etc/NetworkManager/NetworkManager.conf
...
dns=dnsmasq
...

Because of this, resolv.conf is not regenerated anymore. Instead, dnsmasq will act as one DNS cache. Since the change to resolv.conf will not be lost, we can edit it safely:

nameserver 127.0.0.1
nameserver 208.67.222.222
nameserver 208.67.220.220