Changing DNS in Linux

For whatever reason, you want to change your DNS, you need to change it at resolv.conf

First change your directory to /etc.
cd /etc

if you type in ls -l, you will see resolv.conf file.

you have to sudo or su to make changes

sudo nano resolv.conf

if there is existing dns, you can hash it out. Just put # in front of the address

and then type in the new nameservers

you can use openDNS, Googles DNS or any DNS that you prefer.

OpenDNS 1: 208.67.222.222
OpenDNS 2: 208.67.220.220

ctrl + O
Enter

ctrl +x