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' /etc/resolv.conf 

In the above example IP address 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' /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' /etc/resolv.conf 

Designed by SanjuD(@ngineerbabu)