OpenDNS

From ArchWiki
Revision as of 04:47, 8 August 2008 by Anonymo (Talk | contribs) (New page: == OpenDNS == --~~~~ OpenDNS is a better DNS service. If you Internet pages are loading slow or if you want to make your Internet safer, faster, smarter and more reliable, try OpenDNS o...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

== OpenDNS == --Anonymo 00:47, 8 August 2008 (EDT)

OpenDNS is a better DNS service. If you Internet pages are loading slow or if you want to make your Internet safer, faster, smarter and more reliable, try OpenDNS on your computer.

Your ISP is provides [usually] working dns servers; however, the router sometimes adds an extra DNS server, in case you have your own cache server (which would be slightly faster). This isn't a problem for windows users, because if a DNS server is slow or not doesn't work it will immediately switch to another one. However, Linux takes longer to timeout (which is why you are getting a delay).

To check if this is the case:

Check /etc/resolv.conf for the ip address of the servers.  Then type (in a terminal) ping <one of the ip addresses>, and see how long the responses takes.

If one of the responses takes a long time (or times out), then you can just delete it from resolve.conf. However, depending on you network setup, the file may get rewritten every time you reconnect to the network (like when rebooting). In that case, you can block that ip in hosts.deny, or if you use iptables, you can add a rule to block that ip (the latter is what I did).

What do I do?

To speed things up, use OpenDNS. Edit /etc/resolv.conf and enter the ip's of the OpenDNS servers:

nameserver 208.67.222.222
nameserver 208.67.220.220

If you are using dhcp, edit /etc/conf.d/ and make it look like this:

DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"

Make sure you have the -R. This will prevent dhcpcd from dynamically creating and destroying this file, and will force it to use OpenDNS, via the IP's you specified in /etc/resolv.conf If you fail to do this, dhcpcd will overwrite your info, negating this whole exercise.

You may also specify these IP's in your router under the DNS tab, and merely point to your router's IP from /etc/resolv.conf.

If you have a laptop that you roam with (assuming you have iptables setup): Where the x's is the bad ip address

iptables  -A OUTPUT -d xxx.xxx.x.x  -j REJECT
iptables-save>/etc/iptables/iptables.rules

The first step tells iptables to reject connections to that nameserver. This causes the nameserver to immediately timeout. The second step saves the iptables rule.