Преглед изворни кода

Note about hosts file for pi-hole

Bob Mottram пре 7 година
родитељ
комит
36d73b2a6c
2 измењених фајлова са 33 додато и 20 уклоњено
  1. 7
    2
      doc/EN/app_pihole.org
  2. 26
    18
      website/EN/app_pihole.html

+ 7
- 2
doc/EN/app_pihole.org Прегледај датотеку

@@ -32,11 +32,17 @@ When that's done select *About this system* from the control panel and see the I
32 32
 
33 33
 * On each client system within your local network
34 34
 
35
+Make sure that you add the static IP address for the server to */etc/hosts*.
36
+
37
+#+begin_src bash
38
+STATIC_IP=[your server static IP]
39
+sudo echo "$STATIC_IP [your domain name]" >> /etc/hosts
40
+#+end_src
41
+
35 42
 On Arch/Parabola:
36 43
 
37 44
 #+begin_src bash
38 45
 sudo pacman -S openresolv
39
-STATIC_IP=[your server static IP]
40 46
 sudo sed -i "s|#name_servers=.*|name_servers=$STATIC_IP|g" /etc/resolvconf.conf
41 47
 sudo sed -i "s|name_servers=.*|name_servers=$STATIC_IP|g" /etc/resolvconf.conf
42 48
 sudo chattr -i /etc/resolv.conf
@@ -47,7 +53,6 @@ Or on a Debian based system:
47 53
 
48 54
 #+begin_src bash
49 55
 sudo apt-get install resolvconf
50
-STATIC_IP=[your server static IP]
51 56
 echo 'domain localdomain' > /tmp/resolvconf
52 57
 echo 'search localdomain' >> /tmp/resolvconf
53 58
 echo "nameserver $STATIC_IP" >> /tmp/resolvconf

+ 26
- 18
website/EN/app_pihole.html Прегледај датотеку

@@ -3,7 +3,7 @@
3 3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6
-<!-- 2017-08-21 Mon 22:43 -->
6
+<!-- 2017-08-22 Tue 10:50 -->
7 7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 9
 <title></title>
@@ -264,9 +264,9 @@ You can block ads for any devices connected to your local network by installing
264 264
 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.
265 265
 </p>
266 266
 
267
-<div id="outline-container-orgd27901b" class="outline-2">
268
-<h2 id="orgd27901b">Set a static IP address</h2>
269
-<div class="outline-text-2" id="text-orgd27901b">
267
+<div id="outline-container-org4f58654" class="outline-2">
268
+<h2 id="org4f58654">Set a static IP address</h2>
269
+<div class="outline-text-2" id="text-org4f58654">
270 270
 <p>
271 271
 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>.
272 272
 </p>
@@ -277,16 +277,25 @@ When that's done select <b>About this system</b> from the control panel and see
277 277
 </div>
278 278
 </div>
279 279
 
280
-<div id="outline-container-orgf682f48" class="outline-2">
281
-<h2 id="orgf682f48">On each client system within your local network</h2>
282
-<div class="outline-text-2" id="text-orgf682f48">
280
+<div id="outline-container-orgc2fe39b" class="outline-2">
281
+<h2 id="orgc2fe39b">On each client system within your local network</h2>
282
+<div class="outline-text-2" id="text-orgc2fe39b">
283
+<p>
284
+Make sure that you add the static IP address for the server to <b>/etc/hosts</b>.
285
+</p>
286
+
287
+<div class="org-src-container">
288
+<pre><code class="src src-bash"><span class="org-variable-name">STATIC_IP</span>=[your server static IP]
289
+sudo echo <span class="org-string">"$STATIC_IP [your domain name]"</span> &gt;&gt; /etc/hosts
290
+</code></pre>
291
+</div>
292
+
283 293
 <p>
284 294
 On Arch/Parabola:
285 295
 </p>
286 296
 
287 297
 <div class="org-src-container">
288 298
 <pre><code class="src src-bash">sudo pacman -S openresolv
289
-<span class="org-variable-name">STATIC_IP</span>=[your server static IP]
290 299
 sudo sed -i <span class="org-string">"s|#name_servers=.*|name_servers=$STATIC_IP|g"</span> /etc/resolvconf.conf
291 300
 sudo sed -i <span class="org-string">"s|name_servers=.*|name_servers=$STATIC_IP|g"</span> /etc/resolvconf.conf
292 301
 sudo chattr -i /etc/resolv.conf
@@ -300,7 +309,6 @@ Or on a Debian based system:
300 309
 
301 310
 <div class="org-src-container">
302 311
 <pre><code class="src src-bash">sudo apt-get install resolvconf
303
-<span class="org-variable-name">STATIC_IP</span>=[your server static IP]
304 312
 <span class="org-builtin">echo</span> <span class="org-string">'domain localdomain'</span> &gt; /tmp/resolvconf
305 313
 <span class="org-builtin">echo</span> <span class="org-string">'search localdomain'</span> &gt;&gt; /tmp/resolvconf
306 314
 <span class="org-builtin">echo</span> <span class="org-string">"nameserver $STATIC_IP"</span> &gt;&gt; /tmp/resolvconf
@@ -312,9 +320,9 @@ sudo resolvconf -u
312 320
 </div>
313 321
 </div>
314 322
 
315
-<div id="outline-container-org1c0c248" class="outline-2">
316
-<h2 id="org1c0c248">On your internet router</h2>
317
-<div class="outline-text-2" id="text-org1c0c248">
323
+<div id="outline-container-org3124632" class="outline-2">
324
+<h2 id="org3124632">On your internet router</h2>
325
+<div class="outline-text-2" id="text-org3124632">
318 326
 <p>
319 327
 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.
320 328
 </p>
@@ -324,9 +332,9 @@ Edit the DNS settings and add the IPv4 address which you got from the control pa
324 332
 </p>
325 333
 </div>
326 334
 
327
-<div id="outline-container-org8f47626" class="outline-3">
328
-<h3 id="org8f47626">LibreCMC</h3>
329
-<div class="outline-text-3" id="text-org8f47626">
335
+<div id="outline-container-org2c8b1c5" class="outline-3">
336
+<h3 id="org2c8b1c5">LibreCMC</h3>
337
+<div class="outline-text-3" id="text-org2c8b1c5">
330 338
 <p>
331 339
 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.
332 340
 </p>
@@ -334,9 +342,9 @@ On a router running LibreCMC from the <b>Network</b> menu select <b>DHCP and DNS
334 342
 </div>
335 343
 </div>
336 344
 
337
-<div id="outline-container-orgb10bacb" class="outline-2">
338
-<h2 id="orgb10bacb">Configuring block lists</h2>
339
-<div class="outline-text-2" id="text-orgb10bacb">
345
+<div id="outline-container-orgff38fd6" class="outline-2">
346
+<h2 id="orgff38fd6">Configuring block lists</h2>
347
+<div class="outline-text-2" id="text-orgff38fd6">
340 348
 <p>
341 349
 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.
342 350
 </p>