Update pihole setup instructions

This commit is contained in:
Bob Mottram 2017-08-21 22:32:11 +01:00
parent 79dd2521db
commit fe107b6fe5
2 changed files with 52 additions and 38 deletions

View File

@ -32,21 +32,28 @@ When that's done select *About this system* from the control panel and see the I
* On each client system within your local network * On each client system within your local network
On Arch/Parabola:
#+begin_src bash #+begin_src bash
sudo pacman -S openresolv
STATIC_IP=[your server static IP]
sudo sed -i "s|#name_servers=.*|name_servers=$STATIC_IP|g" /etc/resolvconf.conf
sudo sed -i "s|name_servers=.*|name_servers=$STATIC_IP|g" /etc/resolvconf.conf
sudo chattr -i /etc/resolv.conf sudo chattr -i /etc/resolv.conf
sudo nano /etc/resolv.conf sudo resolvconf -u
#+end_src #+end_src
Comment out any existing entries with a # character and add: Or on a Debian based sustem:
#+begin_src bash #+begin_src bash
nameserver [IPv4 address from the About screen] sudo apt-get install resolvconf
#+end_src STATIC_IP=[your server static IP]
echo 'domain localdomain' > /tmp/resolvconf
Normally /resolv.conf/ will be overwritten every time your reboot, but you can prevent this with: echo 'search localdomain' >> /tmp/resolvconf
echo "nameserver $STATIC_IP" >> /tmp/resolvconf
#+begin_src bash sudo mv /tmp/resolvconf /etc/resolvconf/resolv.conf.d/head
sudo chattr +i /etc/resolv.conf sudo chattr -i /etc/resolv.conf
sudo resolvconf -u
#+end_src #+end_src
* On your internet router * On your internet router

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2016-11-12 Sat 23:53 --> <!-- 2017-08-21 Mon 22:30 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title> <title></title>
@ -71,6 +71,7 @@
pre.src-fortran:before { content: 'Fortran'; } pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; } pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; } pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; } pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; } pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; } pre.src-latex:before { content: 'LaTeX'; }
@ -188,7 +189,7 @@
@licstart The following is the entire license notice for the @licstart The following is the entire license notice for the
JavaScript code in this tag. JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc. Copyright (C) 2012-2017 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU redistribute it and/or modify it under the terms of the GNU
@ -263,9 +264,9 @@ You can block ads for any devices connected to your local network by installing
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. 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.
</p> </p>
<div id="outline-container-org28ca84b" class="outline-2"> <div id="outline-container-org274081b" class="outline-2">
<h2 id="org28ca84b">Set a static IP address</h2> <h2 id="org274081b">Set a static IP address</h2>
<div class="outline-text-2" id="text-org28ca84b"> <div class="outline-text-2" id="text-org274081b">
<p> <p>
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>. 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>.
</p> </p>
@ -276,38 +277,44 @@ When that's done select <b>About this system</b> from the control panel and see
</div> </div>
</div> </div>
<div id="outline-container-org8d14e27" class="outline-2"> <div id="outline-container-org64ddba0" class="outline-2">
<h2 id="org8d14e27">On each client system within your local network</h2> <h2 id="org64ddba0">On each client system within your local network</h2>
<div class="outline-text-2" id="text-org8d14e27"> <div class="outline-text-2" id="text-org64ddba0">
<div class="org-src-container">
<pre class="src src-bash">sudo chattr -i /etc/resolv.conf
sudo nano /etc/resolv.conf
</pre>
</div>
<p> <p>
Comment out any existing entries with a # character and add: On Arch/Parabola:
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-bash">nameserver [IPv4 address from the About screen] <pre><code class="src src-bash">sudo pacman -S openresolv
</pre> <span class="org-variable-name">STATIC_IP</span>=[your server static IP]
sudo sed -i <span class="org-string">"s|#name_servers=.*|name_servers=$STATIC_IP|g"</span> /etc/resolvconf.conf
sudo sed -i <span class="org-string">"s|name_servers=.*|name_servers=$STATIC_IP|g"</span> /etc/resolvconf.conf
sudo chattr -i /etc/resolv.conf
sudo resolvconf -u
</code></pre>
</div> </div>
<p> <p>
Normally <i>resolv.conf</i> will be overwritten every time your reboot, but you can prevent this with: Or on a Debian based sustem:
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-bash">sudo chattr +i /etc/resolv.conf <pre><code class="src src-bash">sudo apt-get install resolvconf
</pre> <span class="org-variable-name">STATIC_IP</span>=[your server static IP]
<span class="org-builtin">echo</span> <span class="org-string">'domain localdomain'</span> &gt; /tmp/resolvconf
<span class="org-builtin">echo</span> <span class="org-string">'search localdomain'</span> &gt;&gt; /tmp/resolvconf
<span class="org-builtin">echo</span> <span class="org-string">"nameserver $STATIC_IP"</span> &gt;&gt; /tmp/resolvconf
sudo mv /tmp/resolvconf /etc/resolvconf/resolv.conf.d/head
sudo chattr -i /etc/resolv.conf
sudo resolvconf -u
</code></pre>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgb95e44f" class="outline-2"> <div id="outline-container-org7512e86" class="outline-2">
<h2 id="orgb95e44f">On your internet router</h2> <h2 id="org7512e86">On your internet router</h2>
<div class="outline-text-2" id="text-orgb95e44f"> <div class="outline-text-2" id="text-org7512e86">
<p> <p>
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. 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.
</p> </p>
@ -317,9 +324,9 @@ Edit the DNS settings and add the IPv4 address which you got from the control pa
</p> </p>
</div> </div>
<div id="outline-container-orge5bdb7f" class="outline-3"> <div id="outline-container-orgb9b9a80" class="outline-3">
<h3 id="orge5bdb7f">LibreCMC</h3> <h3 id="orgb9b9a80">LibreCMC</h3>
<div class="outline-text-3" id="text-orge5bdb7f"> <div class="outline-text-3" id="text-orgb9b9a80">
<p> <p>
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. 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.
</p> </p>
@ -327,9 +334,9 @@ On a router running LibreCMC from the <b>Network</b> menu select <b>DHCP and DNS
</div> </div>
</div> </div>
<div id="outline-container-org71dabfb" class="outline-2"> <div id="outline-container-org85d7c07" class="outline-2">
<h2 id="org71dabfb">Configuring block lists</h2> <h2 id="org85d7c07">Configuring block lists</h2>
<div class="outline-text-2" id="text-org71dabfb"> <div class="outline-text-2" id="text-org85d7c07">
<p> <p>
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. 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.
</p> </p>