app_pihole.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  5. <head>
  6. <title></title>
  7. <!-- 2018-04-12 Thu 12:30 -->
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  9. <meta name="generator" content="Org-mode" />
  10. <meta name="author" content="Bob Mottram" />
  11. <meta name="description" content="How to block ads on your network"
  12. />
  13. <meta name="keywords" content="freedombone, pi-hole, ad blocker" />
  14. <style type="text/css">
  15. <!--/*--><![CDATA[/*><!--*/
  16. .title { text-align: center; }
  17. .todo { font-family: monospace; color: red; }
  18. .done { color: green; }
  19. .tag { background-color: #eee; font-family: monospace;
  20. padding: 2px; font-size: 80%; font-weight: normal; }
  21. .timestamp { color: #bebebe; }
  22. .timestamp-kwd { color: #5f9ea0; }
  23. .right { margin-left: auto; margin-right: 0px; text-align: right; }
  24. .left { margin-left: 0px; margin-right: auto; text-align: left; }
  25. .center { margin-left: auto; margin-right: auto; text-align: center; }
  26. .underline { text-decoration: underline; }
  27. #postamble p, #preamble p { font-size: 90%; margin: .2em; }
  28. p.verse { margin-left: 3%; }
  29. pre {
  30. border: 1px solid #ccc;
  31. box-shadow: 3px 3px 3px #eee;
  32. padding: 8pt;
  33. font-family: monospace;
  34. overflow: auto;
  35. margin: 1.2em;
  36. }
  37. pre.src {
  38. position: relative;
  39. overflow: visible;
  40. padding-top: 1.2em;
  41. }
  42. pre.src:before {
  43. display: none;
  44. position: absolute;
  45. background-color: white;
  46. top: -10px;
  47. right: 10px;
  48. padding: 3px;
  49. border: 1px solid black;
  50. }
  51. pre.src:hover:before { display: inline;}
  52. pre.src-sh:before { content: 'sh'; }
  53. pre.src-bash:before { content: 'sh'; }
  54. pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
  55. pre.src-R:before { content: 'R'; }
  56. pre.src-perl:before { content: 'Perl'; }
  57. pre.src-java:before { content: 'Java'; }
  58. pre.src-sql:before { content: 'SQL'; }
  59. table { border-collapse:collapse; }
  60. caption.t-above { caption-side: top; }
  61. caption.t-bottom { caption-side: bottom; }
  62. td, th { vertical-align:top; }
  63. th.right { text-align: center; }
  64. th.left { text-align: center; }
  65. th.center { text-align: center; }
  66. td.right { text-align: right; }
  67. td.left { text-align: left; }
  68. td.center { text-align: center; }
  69. dt { font-weight: bold; }
  70. .footpara:nth-child(2) { display: inline; }
  71. .footpara { display: block; }
  72. .footdef { margin-bottom: 1em; }
  73. .figure { padding: 1em; }
  74. .figure p { text-align: center; }
  75. .inlinetask {
  76. padding: 10px;
  77. border: 2px solid gray;
  78. margin: 10px;
  79. background: #ffffcc;
  80. }
  81. #org-div-home-and-up
  82. { text-align: right; font-size: 70%; white-space: nowrap; }
  83. textarea { overflow-x: auto; }
  84. .linenr { font-size: smaller }
  85. .code-highlighted { background-color: #ffff00; }
  86. .org-info-js_info-navigation { border-style: none; }
  87. #org-info-js_console-label
  88. { font-size: 10px; font-weight: bold; white-space: nowrap; }
  89. .org-info-js_search-highlight
  90. { background-color: #ffff00; color: #000000; font-weight: bold; }
  91. /*]]>*/-->
  92. </style>
  93. <link rel="stylesheet" type="text/css" href="freedombone.css" />
  94. <script type="text/javascript">
  95. /*
  96. @licstart The following is the entire license notice for the
  97. JavaScript code in this tag.
  98. Copyright (C) 2012-2013 Free Software Foundation, Inc.
  99. The JavaScript code in this tag is free software: you can
  100. redistribute it and/or modify it under the terms of the GNU
  101. General Public License (GNU GPL) as published by the Free Software
  102. Foundation, either version 3 of the License, or (at your option)
  103. any later version. The code is distributed WITHOUT ANY WARRANTY;
  104. without even the implied warranty of MERCHANTABILITY or FITNESS
  105. FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
  106. As additional permission under GNU GPL version 3 section 7, you
  107. may distribute non-source (e.g., minimized or compacted) forms of
  108. that code without the copy of the GNU GPL normally required by
  109. section 4, provided you include this license notice and a URL
  110. through which recipients can access the Corresponding Source.
  111. @licend The above is the entire license notice
  112. for the JavaScript code in this tag.
  113. */
  114. <!--/*--><![CDATA[/*><!--*/
  115. function CodeHighlightOn(elem, id)
  116. {
  117. var target = document.getElementById(id);
  118. if(null != target) {
  119. elem.cacheClassElem = elem.className;
  120. elem.cacheClassTarget = target.className;
  121. target.className = "code-highlighted";
  122. elem.className = "code-highlighted";
  123. }
  124. }
  125. function CodeHighlightOff(elem, id)
  126. {
  127. var target = document.getElementById(id);
  128. if(elem.cacheClassElem)
  129. elem.className = elem.cacheClassElem;
  130. if(elem.cacheClassTarget)
  131. target.className = elem.cacheClassTarget;
  132. }
  133. /*]]>*///-->
  134. </script>
  135. </head>
  136. <body>
  137. <div id="preamble" class="status">
  138. <a name="top" id="top"></a>
  139. </div>
  140. <div id="content">
  141. <h1 class="title"></h1>
  142. <div class="figure">
  143. <p><img src="images/logo.png" alt="logo.png" width="80%" height="10%" align="center" />
  144. </p>
  145. </div>
  146. <div id="outline-container-sec-1" class="outline-2">
  147. <h2 id="sec-1">PI-Hole: The Black Hole for Web Adverts</h2>
  148. <div class="outline-text-2" id="text-1">
  149. <p>
  150. Idiots who have an inflated sense of self-entitlement will tell you that it's <i>your moral duty</i> to view their mind-numbingly tedious corporate ads on their web site or YouTube channel, or else their kids will starve and the sky will fall because their revenue stream will dry up. But that's bullshit. There is nothing intrinsic or morally mandatory about adverts propping up the livelihoods of netizens, and indeed a web not primarily based on advertising money might have been a much better and more interesting place by now, with a lot less spying.
  151. </p>
  152. <p>
  153. Not only are web ads annoying, but they can consume a lot of bandwidth, be a privacy problem in terms of allowing companies to track your browsing habits and also any badly written scripts they contain may introduce exploitable security holes. Also if you're poor then adverts often make you want things that you can't have.
  154. </p>
  155. <p>
  156. You can block ads for any devices connected to your local network by installing the <b>pihole</b> app from <b>Add/Remove Apps</b> on the administrator control panel. This may help to improve overall performance of your devices by not wasting time downloading unwanted images or scripts.
  157. </p>
  158. <p>
  159. Also don't expect perfection. Though many ads may be blocked by this system some will still get through. It's a constant cat and mouse game between advertisers and blockers.
  160. </p>
  161. </div>
  162. </div>
  163. <div id="outline-container-sec-2" class="outline-2">
  164. <h2 id="sec-2">Set a static IP address</h2>
  165. <div class="outline-text-2" id="text-2">
  166. <p>
  167. Ensure that your system has a static local IP address (typically 192.168..) using the option on the control panel. You will also need to know the IP address of your internet router, which is usually <b>192.168.1.1</b> or <b>192.168.1.254</b>.
  168. </p>
  169. <p>
  170. When that's done select <b>About this system</b> from the control panel and see the IPv4 address. You can use this as a DNS address in two ways:
  171. </p>
  172. </div>
  173. </div>
  174. <div id="outline-container-sec-3" class="outline-2">
  175. <h2 id="sec-3">On each client system within your local network</h2>
  176. <div class="outline-text-2" id="text-3">
  177. <p>
  178. Make sure that you add the static IP address for the server to <b>/etc/hosts</b>.
  179. </p>
  180. <div class="org-src-container">
  181. <pre class="src src-bash">STATIC_IP=[your server static IP]
  182. sudo echo "$STATIC_IP [your domain name]" &gt;&gt; /etc/hosts
  183. </pre>
  184. </div>
  185. <p>
  186. On Arch/Parabola:
  187. </p>
  188. <div class="org-src-container">
  189. <pre class="src src-bash">sudo pacman -S openresolv
  190. sudo sed -i "s|#name_servers=.*|name_servers=$STATIC_IP|g" /etc/resolvconf.conf
  191. sudo sed -i "s|name_servers=.*|name_servers=$STATIC_IP|g" /etc/resolvconf.conf
  192. sudo chattr -i /etc/resolv.conf
  193. sudo resolvconf -u
  194. </pre>
  195. </div>
  196. <p>
  197. Or on a Debian based system:
  198. </p>
  199. <div class="org-src-container">
  200. <pre class="src src-bash">sudo apt-get install resolvconf
  201. echo 'domain localdomain' &gt; /tmp/resolvconf
  202. echo 'search localdomain' &gt;&gt; /tmp/resolvconf
  203. echo "nameserver $STATIC_IP" &gt;&gt; /tmp/resolvconf
  204. sudo mv /tmp/resolvconf /etc/resolvconf/resolv.conf.d/head
  205. sudo chattr -i /etc/resolv.conf
  206. sudo resolvconf -u
  207. </pre>
  208. </div>
  209. </div>
  210. </div>
  211. <div id="outline-container-sec-4" class="outline-2">
  212. <h2 id="sec-4">On your internet router</h2>
  213. <div class="outline-text-2" id="text-4">
  214. <p>
  215. If you can access the settings on your local internet router then this is the simplest way to provide ad blocking for all devices which connect to it. Unfortunately some router models don't let you edit the DNS settings and if that's the case you might want to consider getting a different router.
  216. </p>
  217. <p>
  218. Edit the DNS settings and add the IPv4 address which you got from the control panel About screen. Exactly how you do this will just depend upon your particular router model. You may also need to set the same address twice, because two addresses are conventional.
  219. </p>
  220. </div>
  221. <div id="outline-container-sec-4-1" class="outline-3">
  222. <h3 id="sec-4-1">LibreCMC</h3>
  223. <div class="outline-text-3" id="text-4-1">
  224. <p>
  225. On a router running LibreCMC from the <b>Network</b> menu select <b>DHCP and DNS</b>. Enter the static IP address of your Freedombone system within <b>DNS Forwardings</b>, then at the bottom of the page click on <b>Save &amp; Apply</b>. Any devices which connect to your router will now have ad blocking.
  226. </p>
  227. </div>
  228. </div>
  229. </div>
  230. <div id="outline-container-sec-5" class="outline-2">
  231. <h2 id="sec-5">Configuring block lists</h2>
  232. <div class="outline-text-2" id="text-5">
  233. <p>
  234. You can configure the block lists which the system uses by going to the <b>administrator control panel</b>, selecting <b>App Settings</b> then choosing <b>pihole</b>. You can also add any extra domain names to the whitelist if they're being wrongly blocked or to the blacklist if they're not blocked by the current lists.
  235. </p>
  236. <div class="export">
  237. <p>
  238. &lt;center&gt;
  239. Return to the &lt;a href="index.html"&gt;home page&lt;/a&gt;
  240. &lt;/center&gt;
  241. </p>
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. <div id="postamble" class="status">
  247. <style type="text/css">
  248. .back-to-top {
  249. position: fixed;
  250. bottom: 2em;
  251. right: 0px;
  252. text-decoration: none;
  253. color: #000000;
  254. background-color: rgba(235, 235, 235, 0.80);
  255. font-size: 12px;
  256. padding: 1em;
  257. display: none;
  258. }
  259. .back-to-top:hover {
  260. background-color: rgba(135, 135, 135, 0.50);
  261. }
  262. </style>
  263. <div class="back-to-top">
  264. <a href="#top">Back to top</a> | <a href="mailto:bob@freedombone.net">E-mail me</a>
  265. </div>
  266. </div>
  267. </body>
  268. </html>