changing dns linux code example
Example 1: change dns linux
sudo vim /etc/resolvconf/resolv.conf.d/base
# add nameserver(s) like this.
nameserver 8.8.8.8
nameserver 8.8.4.4
$ sudo resolvconf -u
Example 2: change dns resolver linux
$ sudo vim /etc/resolvconf/resolv.conf.d/base