How to set DNS server in Linux

Domain Name Server (DNS) resolver or nameserver is a server that your computer talks with to convert domain names to IP addresses. If you are using DHCP on your computer, these servers are typically configured automatically for you. If you want to set a static IP address for your computer, you can set the DNS servers in the GUI of most Linux systems like Ubuntu for example.

The DNS servers are listed in the /etc/resolv.conf file. You can set them manually by editing this file and adding one line for each DNS server.

For example, to add the OpenDNS IP addresses, I add these lines to the file:


Tried with: Raspbian 7

One thought on “How to set DNS server in Linux”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s