Change Nameserver using NetworkManager

Do not edit /etc/resolv.conf. It will likely be replaced by NetworkManager. Open a shell and add nameserver for existing connection.

nmcli con mod $ssid ipv4.dns ""

The SSID can be found with nmcli con.

Replace the IP addresses to your desired ones.

Now restart the connection to apply the changes.

nmcli con down $ssid
nmcli con up $ssid

Verify with cat /etc/resolv.conf.