XU4 v133 pihole

Hi Fourdee,

Thanks for the new release. I have been using Pihole for some time originally on BananaPi/Bananian so when I switched to XU4 and DietPi I kept doing it the old way by installing with the curl method. The v133 update stopped this working so I have switched to the DietPi fork and this is working fine - but one question - is it possible to prevent the 404 errors as the original version of Pihole did? Not a big deal really - I don’t do any browsing on the XU4 itself - I think the 404 method you use is to allow this?

Thanks, John

Think I have fixed this by creating an empty index.html in the /var/www/pihole directory - at least this works when I look at the NZ Herald app on my ipad :slight_smile:

Hi John,

This code is ran during the PiHole install with DietPi for 404:

#Generate index page that replaces adverts
cat << _EOF_ > /var/www/index.html
<html>
Blocked by Pi-hole.
<script>window.close();</script>
</html>
_EOF_

window.close should automatically close any popups.

by installing with the curl method
The v133 update stopped this working so I have switched to the DietPi fork and this is working fine

Bizarre, was this from v132 to v133 or an earlier version? The v132 patch code has no effect on PiHole (from what I can see)

Yes this was from v132. I tried to reinstall a couple of times but the same happened but your version is working nicely.

John

Hi Fourdee,

To confirm my findings I did a new DietPi v133 install on a Pi3. After all the updates I installed PiHole using the curl method. Same result - ads aren’t blocked.

John

Thanks John,

I’ll take a look: https://github.com/Fourdee/DietPi/issues/551

Hi John,

Seems to be working for me on RPi 3 with fresh install of v133 image:


Blocking ads visually also (tested with hotmail).

Whats your IP address settings on the client and PiHole system?

I installed PiHole using the curl method

Sorry John, missed this bit, let me re-test. (Above test is with DietPi-Software installed version)

Install log:

root@DietPi:~# curl -L https://install.pi-hole.net | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
:::
::: You are root.
100 34419  100 34419    0     0  46908      0 --:--:-- --:--:-- --:--:-- 46908
bash: line 929: [: =: unary operator expected
::: Verifying free disk space...
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your pi is up to date! Continuing with pi-hole installation...
:::
::: Checking installer dependencies...
:::    Checking for apt-utils... already installed!
:::    Checking for whiptail... already installed!
:::    Checking for dhcpcd5... Not found! Installing.... done!
::: Using interface: eth0
:::
::: Setting IP to 192.168.0.104/24.  You may need to restart after the install i                                                                 s complete.
:::
::: Using IPv4 on 192.168.0.104/24
::: IPv6 will NOT be used.
::: Using Google DNS servers.
::: Checking Pi-Hole dependencies:
:::    Checking for dnsutils... Not found! Installing.... done!
:::    Checking for bc... already installed!
:::    Checking for dnsmasq... Not found! Installing.... done!
:::    Checking for lighttpd... Not found! Installing.... done!
:::    Checking for php5-common... Not found! Installing.... done!
:::    Checking for php5-cgi... Not found! Installing.... done!
:::    Checking for php5... Not found! Installing.... done!
:::    Checking for git... Not found! Installing.... done!
:::    Checking for curl... already installed!
:::    Checking for unzip... already installed!
:::    Checking for wget... already installed!
:::    Checking for sudo... already installed!
:::    Checking for netcat... Not found! Installing.... done!
:::    Checking for cron... already installed!
:::    Checking for iproute2... already installed!
:::
::: Stopping services... done.
::: Checking if user 'pihole' exists...
::: User 'pihole' doesn't exist.  Creating...
:::
::: Checking for existing base files...
:::    Checking /etc/.pihole is a repo... not found!!
:::    Cloning https://github.com/pi-hole/pi-hole.git into /etc/.pihole... done!
:::
::: Checking for existing web interface...
:::    Checking /var/www/html/admin is a repo... not found!!
:::    Cloning https://github.com/pi-hole/AdminLTE.git into /var/www/html/admin.                                                                 .. done!
:::
::: Installing scripts to /opt/pihole... done.
:::
::: Installing configs...
:::    Existing dnsmasq.conf found... it is not a pi-hole file, leaving alone!
:::    Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf... done.
:::
::: Creating log file and changing owner to dnsmasq... done!
:::
::: Installing pihole custom index page... done!
::: Installing sudoer file... done!
:::
::: Installing latest Cron script... done!
:::
::: Preparing to run gravity.sh to refresh hosts...
::: Running gravity.sh
:::
::: You are root.
/opt/pihole/gravity.sh: line 49: /etc/pihole/setupVars.conf: No such file or dir                                                                 ectory
::: Neutrino emissions detected...
:::
::: No custom adlist file detected, reading from default file... done!
:::
::: Existing pihole directory found
:::
::: Getting raw.githubusercontent.com list... List updated, transport successful                                                                 !
::: Getting mirror1.malwaredomains.com list... List updated, transport successfu                                                                 l!
::: Getting sysctl.org list... List updated, transport successful!
::: Getting zeustracker.abuse.ch list... List updated, transport successful!
::: Getting s3.amazonaws.com list... List updated, transport successful!
::: Getting s3.amazonaws.com list... List updated, transport successful!
::: Getting hosts-file.net list... List updated, transport successful!
::: Getting raw.githubusercontent.com list... List updated, transport successful                                                                 !
::: Getting ransomwaretracker.abuse.ch list... List updated, transport successfu                                                                 l!
:::
::: Aggregating list of domains... done!
::: Formatting list of domains to remove comments.... done!
::: 129171 domains being pulled in by gravity...
::: Removing duplicate domains.... done!
::: 105034 unique domains trapped in the event horizon.
::: Formatting domains into a HOSTS file...
:::
::: Adding 9 adlist sources to the whitelist... done!
::: Running whitelist script to update HOSTS file.... 7 domains whitelisted!
::: Running blacklist script to update HOSTS file.... 0 domains blacklisted!
:::
::: Cleaning up un-needed files... done!
:::
::: Refresh lists in dnsmasq... done!
::: No firewall detected.. skipping firewall configuration.
::: Restarting services...Synchronizing state for dnsmasq.service with sysvinit                                                                  using update-rc.d...
Executing /usr/sbin/update-rc.d dnsmasq defaults
Executing /usr/sbin/update-rc.d dnsmasq enable
Synchronizing state for lighttpd.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d lighttpd defaults
Executing /usr/sbin/update-rc.d lighttpd enable
 done.
:::
::: Installation Complete! Configure your devices to use the Pi-hole as their DN                                                                 S server using:
:::     192.168.0.104
:::
:::
::: If you set a new IP address, you should restart the Pi.
:::
::: The install log is located at: /etc/pihole/install.log
::: View the web interface at http://pi.hole/admin or http://192.168.0.104/admin



root@DietPi:~# cat /var/log/pihole.log
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 1
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 2
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 3
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 4
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 5
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 6
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 7
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 8
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4117                                                                 9
Oct 11 19:17:03 dnsmasq[5061]: bad address at /etc/pihole/gravity.list line 4118

Appears to be a space before each entry in /etc/pihole/gravity.list:

 DietPi
 pi.hole
 0000mps.webpreview.dsl.net
 0001.2waky.com
 000dom.revenuedirect.com
 00119922.com
 001wen.com
 005.free-counter.co.uk
 006.free-adult-counters.x-xtra.com
 006.free-counter.co.uk

Looks like its missing the source destination in those entries. Should look like this:

192.168.0.100 0000mps.webpreview.dsl.net

Possible bug in their installer:

/opt/pihole/gravity.sh: line 49: /etc/pihole/setupVars.conf: No such file or dir

I’ll need to dig deeper. Issue resolved by running gravity.sh again:

service dnsmasq stop
/opt/pihole/gravity.sh
service dnsmasq start



root@DietPi:~# cat /var/log/pihole.log
0
Oct 11 19:28:01 dnsmasq[7440]: exiting on receipt of SIGTERM
Oct 11 19:28:01 dnsmasq[8175]: started, version 2.72 cachesize 10000
Oct 11 19:28:01 dnsmasq[8175]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect
Oct 11 19:28:01 dnsmasq[8175]: warning: ignoring resolv-file flag because no-resolv is set
Oct 11 19:28:01 dnsmasq[8175]: using nameserver 8.8.4.4#53
Oct 11 19:28:01 dnsmasq[8175]: using nameserver 8.8.8.8#53
Oct 11 19:28:01 dnsmasq[8175]: read /etc/hosts - 2 addresses
Oct 11 19:28:03 dnsmasq[8175]: read /etc/pihole/gravity.list - 105036 addresses

Hi John,

Turns out its an issue with PiHole installation script: https://github.com/pi-hole/pi-hole/issues/777

Will be fixed in their next release.

Workaround is to run pihole -g after installation, refreshing the gravity list:

pihole -g

Hi Fourdee,

Thanks - having switched to your fork I’ll stick with it :slight_smile:

John