DNS server in top priority

Below command will keep your desire DNS server or nameserver address 
to be first address to use for a query of a domain address.
To apply this command root user privilege is require.
 # sed -i '1i nameserver 8.8.8.8' /etc/resolv.conf 

In the above example IP address 8.8.8.8 is a google public DNS IP address
which can be used by anybody and nameserver is syntax for
resolve.conf file to know that is a DNS server IP address at where
it need to be queried for all request domain by users or their application.

Either you can be a root user to run this command as follow
 $ su - 
 # sed -i '1i nameserver 8.8.8.8' /etc/resolv.conf 

Or you can use sudo tool if you are added in a sudoers list or in
the group of sudoers list.
 $ sudo sed -i '1i nameserver 8.8.8.8' /etc/resolv.conf 




Designed by SanjuD(@ngineerbabu)