{"id":29,"date":"2014-07-19T21:57:53","date_gmt":"2014-07-19T21:57:53","guid":{"rendered":"http:\/\/rln.d13dns.com\/?p=29"},"modified":"2014-07-19T21:57:53","modified_gmt":"2014-07-19T21:57:53","slug":"djbdns-dnscache","status":"publish","type":"post","link":"https:\/\/randomlinuxnotes.d13.com\/?p=29","title":{"rendered":"djbdns dnscache"},"content":{"rendered":"<p>This is great simple way to get off of your ISP&#8217;s dns, e.g. stop them redirecting you to their search partner when you typo.  And very handy if you&#8217;re working with DNS or changing webhosts, in that a quick sudo killall dnscache clears out your cache so you can see the new site right away.<\/p>\n<p>#install daemontools (djb does crazy things with symlinks &#8211; trust me when I say you want this package installed and built under \/usr\/local)<br \/>\nyum install gcc<br \/>\ncd \/usr\/local\/src<br \/>\nwget wget http:\/\/cr.yp.to\/daemontools\/daemontools-0.76.tar.gz<br \/>\ntar zxf daemontools-0.76.tar.gz<br \/>\npushd admin\/daemontools-0.76<br \/>\nvi src\/conf-cc # append gcc line with this: -include \/usr\/include\/errno.h<br \/>\n.\/package\/install<br \/>\npopd<\/p>\n<p>#install ucspi<br \/>\nwget http:\/\/cr.yp.to\/ucspi-tcp\/ucspi-tcp-0.88.tar.gz<br \/>\ntar zxf ucspi-tcp-0.88.tar.gz<br \/>\npushd ucspi-tcp-0.88<br \/>\nvi conf-cc # append gcc line with this: -include \/usr\/include\/errno.h<br \/>\nmake setup check<br \/>\npopd<\/p>\n<p>#install djbdns<br \/>\nwget http:\/\/cr.yp.to\/djbdns\/djbdns-1.05.tar.gz<br \/>\ntar zxf djbdns-1.05.tar.gz<br \/>\npushd djbdns-1.05<br \/>\nvi conf-cc  # append gcc line with this: -include \/usr\/include\/errno.h<br \/>\nmake setup check<br \/>\npopd<\/p>\n<p>#install a local dns server for looking up addresses<br \/>\nuseradd -d \/var\/dnscache -s \/bin\/false dnscache<br \/>\nuseradd -d \/var\/dnscache -s \/bin\/false dnslog<br \/>\nrm \/var\/dnscache\/.bash*<br \/>\ndnscache-conf dnscache dnslog \/var\/dnscache 127.0.0.1<br \/>\ntouch \/var\/dnscache\/root\/ip\/127.0.0.1<br \/>\nln -sf \/var\/dnscache \/service\/<\/p>\n<p>#update the root nameservers that dnscache above uses<br \/>\nyum install bind-utils<br \/>\nfor file in `dig |grep root-servers.net|awk &#039;{ print $5 }&#039;`;do host $file;done|grep -v IPv6|grep -v mail|grep -v pointer|awk &#039;{ print $4 }&#039;|sort -n &gt; \/var\/dnscache\/root\/servers\/@<\/p>\n<p>#setup svscan<br \/>\n# this next line is for centos and kin (ubuntu doesn&#8217;t seem to have \/etc\/inittab<br \/>\nvi \/etc\/inittab # get rid of this line: SV:123456:respawn:\/command\/svscanboot<br \/>\n# the next 5 lines are for both centos and kin, and for ubuntu and kin<br \/>\necho &quot; start on runlevel [12345]&quot; &gt; \/etc\/init\/svscan.conf<br \/>\necho &quot;respawn&quot; &gt;&gt; \/etc\/init\/svscan.conf<br \/>\necho &quot;exec \/command\/svscanboot&quot; &gt;&gt; \/etc\/init\/svscan.conf<br \/>\ninitctl reload-configuration<br \/>\ninitctl start svscan<\/p>\n<p>The above is a copy from my other post: http:\/\/rln.d13dns.com\/2014\/07\/20\/new-vps-with-centos-6-for-tinydns-secondary\/<\/p>\n<p>Others have also talked about setting up dnscache:<br \/>\nhttp:\/\/packetnexus.com\/2010\/12\/how-to-install-djbs-dnscache-on-ubuntu-10-10\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is great simple way to get off of your ISP&#8217;s dns, e.g. stop them redirecting you to their search partner when you typo. And very handy if you&#8217;re working with DNS or changing webhosts, in that a quick sudo killall dnscache clears out your cache so you can see [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[25,40,41,72],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-rln","tag-centos6","tag-djbdns","tag-dnscache","tag-local-nameserver-on-linux"],"_links":{"self":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":0,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}