From ArchWiki
Revision as of 01:31, 4 November 2009 by Fukawi2 (talk | contribs) (Using OpenDNS: Added warning about OpenDNS and debugging.)
Jump to: navigation, search

OpenDNS is an alternative DNS service.

DNS in Linux

Your ISP (usually) provides working DNS servers, and a router may also add an extra DNS server in case you have your own cache server. Switching between DNS servers does not represent a problem for Windows users, because if a DNS server is slow or does not work it will immediately switch to a better one. However, Linux usually takes longer to timeout, which could be the reason why you are getting a delay.

Use dig (provided by package Template:Package Official) before any changes, repeat after making the adjustments in the section below and compare the query time(s):


You can also specify a nameserver:


Using OpenDNS

Edit /etc/resolv.conf and add the OpenDNS nameservers to the top of the file so they are used first, optionally removing already listed servers in order to only use OpenDNS:

# OpenDNS nameservers

Changes made to /etc/resolv.conf take affect immediately.

Warning: The OpenDNS servers ALWAYS respond with an IP address for any query, even if the domain or DNS record doesn't exist. This can cause problems when debugging network issues.


If you are using dhcpcd, edit /etc/dhcpcd.conf and remove domain_name_servers option to make it look like this:

option domain_name, domain_search, host_name

This will prevent dhcpcd from adding other nameservers to resolv.conf.

You will also need to edit or create /etc/resolv.conf.head in order to add the OpenDNS nameservers. The same principles apply as with /etc/resolv.conf; add them to the top of the file and optionally delete the rest:

# OpenDNS nameservers

Dhcpcd dynamically generates /etc/resolv.conf by prepending /etc/resolv.conf.head and parsing options from /etc/dhcpcd.conf.

Restart networking after editing or creating /etc/resolv.conf.head in order for the changes to take effect immediately:

# /etc/rc.d/network restart 
Tip: You may also specify these IPs in your router's configuration interface and merely point to your router's IP from /etc/resolv.conf.


See pdnsd#OpenDNS.

Fixing problems with Google

OpenDNS hijacks Google-searches by routing all queries through their own servers first. This can be annoying because Google searches may slow down noticeably and it also breaks Google's FeelingLucky feature (e.g., entering digg in your adress bar will open For the latter, there is a Firefox-addon that brings back the original behaviour. A more elegant solution is to redirect all queries for Google exclusively to your ISP's DNS Server. This can be done with dnsmasq (see Speeding up DNS with dnsmasq for more information).

External resources