Overall, I rate this project as "advanced" since an experienced Linux user will be able to understand what I planned to do and implement it. YMMV
In this project, I worked at getting polipo to work with pdnsd. My intention was to speed up polipo, the caching web proxy server. Information on polipo is found by entering apt-cache to show its description:
$ apt-cache show polipo
Originally I started with polipo, and noticed that Iceweasel was lofting and wait times while loading web pages was over 15 seconds. After searching on the Internet for "speed up polipo" I happened on a post on the crunchbang.org forum by "hardran3" entitled '"Faster" browsing with polipo & pdnsd.'
Polipo is configured to show:
- its menu at http://127.0.0.1:8123/polipo/
- its status at http://127.0.0.1:8123/polipo/status?
- its current configuration at http://127.0.0.1:8123/polipo/config?
- its known servers at http://127.0.0.1:8123/polipo/servers? and
- and its disk cache index at http://127.0.0.1:8123/polipo/index?
Pdnsd is the proxy DNS server with permanent caching. More information on it is found by entering apt-cache to show its description: $ apt-cache show pdnsd
After installing polipo, I edited /etc/polipo/config without ad-blocking and allowed the amount of information leaked by commenting the lines for censoredHeaders and censorReferer.
In this way it was adapted for Crunchbang Linux on my desktop PC which is directly connected to the Internet via aDSL modem / router.
Next, /etc/pdnsd.conf was edited using the configuration shown. However, the original text for pdnds.conf was missing a "}", so the last six lines of the code given should be:
I also opted to keep the following from /etc/pdnsd.conf:
However, the above 7 lines are optional. Finally I edited the /etc/dhcp/dhclient.conf file as directed.
In order to get pdnsd to run, the file /etc/default/pdnsd also needs to be edited as follows:
01: # do we start pdnsd ?
* Note that I prefaced lines in the respective configuration files with line numbers. This is for information purposes and should be left out in each file.
To get dhclient to restart, unplug the network cable and plug it back in. If it still isn't reset, do not worry. Just start up polipo with: $ sudo /etc/init.d/polipo restart
The system will respond with: Restarting polipo: polipo. ...and start up pdnsd with:
$ sudo /etc/init.d/pdnsd restart
To which the system will respond with: [ ok ] Restarting pdnsd (via systemctl): pdnsd.service.
To check the status of and ensure pdnsd is running: $ sudo /etc/init.d/pdnsd status
The system will respond with:
● pdnsd.service - LSB: Start pdnsd
Loaded: loaded (/etc/init.d/pdnsd)
Active: active (running) since Sat 2015-02-14 01:17:28 PST; 2h 42min ago
Process: 24149 ExecStop=/etc/init.d/pdnsd stop (code=exited, status=0/SUCCESS)
Process: 24156 ExecStart=/etc/init.d/pdnsd start (code=exited, status=0/SUCCESS)
└─24161 /usr/sbin/pdnsd --daemon -p /var/run/pdnsd.pid
Once pdnsd is running, polipo is using 127.0.0.1 as the address for the internal DNS server. Overall, the time spent debugging was due to pdnsd not starting up.
Once it started running, I got the following response using netstat: $ sudo netstat -atunp | grep "127.0.0.1:53"
Internet response times are improved. Most of the webpages are cached permanently in /var/cache/polipo and the DNS information in /var/cache/pdnsd - this allows for faster access to webpages because they are permanently stored in cache.
I have also added the polipo and pdnsd packages to my netbook which runs Mint 17.1.
Sometimes I get one webpage that never resolves on my netbook. After careful research of the issue (504 Gateway error) led me to reinstall resolvconf. Then I added GoogleDNS to server section in /etc/pdsnd.conf to improve lag time:
label = "GoogleDNS";
After forcing a reload of pdnsd, I could access the webpage.
Kudos: Thanks to Hardran3 for the tips on getting polipo to work with pdnsd, and especially to Jiri H for developing Crunchbang Linux.
While development of Crunchbang Linux is finished, I will still use it because it still works.
Caching Web Proxy and DNS Server pictures:
» Tips, Tricks & Scripts
» "Faster" browsing with polipo & pdnsd
Mint Linux is derived from Ubuntu, and the following link helped with resolve the 504 Gateway error: