|
I recently moved to Fort Mitchell, Kentucky and have a 40MB insightbb / comcast internet account. It is blazingly fast on downloads and uploads....when they actually start. However, there is a huge latency in name server resolution. This is solved by using a caching nameserver (and I also throw in a proxy for added saftey and speedup). First, there is a bug in sabayonlinux pdnsd. So, don't even try to install from repository. Do it the gentoo way: # emerge --sync # echo "net-dns/pdnsd -ipv6" >> /etc/portage/package.use # emerge -v pdnsd polipo Next, copy the /etc/pdnsd/pdnsd.conf.sample to /etc/pdnsd/pdnsd.conf: # cp /etc/pdnsd/pdnsd.conf.sample /etc/pdnsd/pdnsd.conf Edit the file for your computer. Here are my settings (will likely need modified for your settings, especially the interface): --------------------------------------------------------------------------------------- global { perm_cache=1024; cache_dir="/var/cache/pdnsd"; # pid_file = /var/run/pdnsd.pid; run_as="pdnsd"; server_ip = 127.0.0.1; # Use eth0 here if you want to allow other # machines on your network to query pdnsd. status_ctl = on; # paranoid=on; # This option reduces the chance of cache poisoning # but may make pdnsd less efficient, unfortunately. query_method=udp_tcp; min_ttl=15m; # Retain cached entries at least 15 minutes. max_ttl=1w; # One week. timeout=10; # Global timeout option (10 seconds). }
# The following section is most appropriate if you have a fixed connection to # the Internet and an ISP which provides good DNS servers. server { label= "myisp"; ip = 208.67.222.222, 208.67.220.220; # Put your ISP's DNS-server address(es) here. I used opendns.org server ips but you can use your isp's if they are reliable. # proxy_only=on; # Do not query any name servers beside your ISP's. # This may be necessary if you are behind some # kind of firewall and cannot receive replies # from outside name servers. timeout=4; # Server timeout; this may be much shorter # that the global timeout option. uptest=if; # Test if the network interface is active. interface=wlan0; # The name of the interface to check. interval=10m; # Check every 10 minutes. purge_cache=off; # Keep stale cache entries in case the ISP's # DNS servers go offline. }
source { owner=localhost; # serve_aliases=on; file="/etc/hosts"; }
rr { name=localhost; reverse=on; a=127.0.0.1; owner=localhost; soa=localhost,root.localhost,42,86400,900,86400,86400; } ------------------------------------------------------------------------------- After you have the above file configured, next edit the /etc/resolv.conf file and comment out everything, or simply mv the file out of the way and recreate it: # mv /etc/resolv.conf /etc/resolv.conf.orig # echo "nameserver 127.0.0.1" >> /etc/resolv.conf Now start pdnsd: # /etc/init.d/pdnsd start Test it using nslookup: # nslookup google.com 127.0.0.1 if it returns looking like this, it is successful: Server: 127.0.0.1 Address: 127.0.0.1#53
Non-authoritative answer: Name: google.com Address: 74.125.127.100 Name: google.com Address: 74.125.67.100 Name: google.com Address: 74.125.45.100 Next, on to configuring polipo: Edit /etc/polipo/config: and verify the proxyAddress=127.0.0.1 and allowedClients-127.0.0.1 Here is what mine looks like: ----------------------------------------------------------------------------- daemonise=false diskCacheRoot=/var/cache/polipo/ proxyAddress=127.0.0.1 proxyName=localhost serverSlots=4 serverMaxSlots=8 cacheIsShared=true allowedClients=127.0.0.1 ------------------------------------------------------------------------------- Once you have this done, start polipo: # /etc/init.d/polipo start Configure your browser to use the polipo proxy: In firefox, go to edit - preferences: Go to Advanced - Network - Settings Select Manual Proxy Configuration and enter 127.0.0.1 for the proxy server and 8123 for the port. Restart firefox Check web browsing is working. Add both to your startup: # rc-update add pdnsd default # rc-update add polipo default Done Write Comment (0 comments) |