How to change DNS servers

In both linux and Solaris and possibly other UNIX’es you can change your DNS servers simply by editing your /etc/resolv.conf

It should look like below.


The nameserver’s or DNS server will try to be connected to in order from top to bottom. The search domains do not matter if they are at the top or bottom. Search domains are usefull if you dont want to have to type in the whole FQDN (Fully Qualified Domain Name). So instead of typing in “ping” you can shorten it to “ping sparky”.