Pine as a Pi-hole ... Does that make it a PineHole?
#1
Just a quick writeup on how I got Pi-Hole running on a Pine A64 512MB.  I am by no means a professional or expert, just know enough to really mess things up!  If I screwed anything up or am doing anything the hard way, please don't hesitate to correct me!

What is Pi-hole?
pi-hole - A black hole for Internet advertisements (designed for Raspberry Pi)
https://pi-hole.net/

Install Ubuntu following damikeh's How To

Boot it up, personally I would suggest changing the default password and possibly adding another account, and changing the hostname but that's just my personal preference.

Update the repos and check for upgrades by running
Code:
sudo apt-get update
sudo apt-get upgrade

Then I installed my preferred CLI txt editor (nano) though any should work.  While we are at it, going to install PHP which we will need for Pi-hole Web Interface

Code:
sudo apt-get install nano php7.0-cgi php7.0-fpm

This may prompt you asking if you want to continue, respond with Y for yes.

Now we need to setup out network with a static IP address.  I'm using the built in ethernet and am setting my IP to 192.168.1.240 and my router is located at 192.168.1.1 and we will use Googles DNS servers
Code:
sudo nano /etc/network/interfaces.d/eth0

By default this will probably look something like
Code:
auto eth0
iface eth0 inet dhcp

But we want it to me more like (changing any values as needed for your local network)
Code:
auto eth0
iface eth0 inet static
address 192.168.1.240
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
dns-nameservers 8.8.8.8 8.8.4.4

Now we need to restart the network so changes take effect, this should be able to be done without restarting the board itself, but none of the usual ways seem to be working for me so we can just reboot the board
Code:
sudo reboot

Now once we login we can check and make sure out network settings are working by running ifconfig
Code:
[email protected]:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 36:c9:e3:f1:b8:05
         inet addr:192.168.1.240  Bcast:192.168.1.255  Mask:255.255.255.0
         inet6 addr: fe80::34c9:e3ff:fef1:b805/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:20537 errors:0 dropped:0 overruns:0 frame:0
         TX packets:19598 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:6151787 (6.1 MB)  TX bytes:3605516 (3.6 MB)
         Interrupt:114

lo        Link encap:Local Loopback
         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING  MTU:65536  Metric:1
         RX packets:264 errors:0 dropped:0 overruns:0 frame:0
         TX packets:264 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:19785 (19.7 KB)  TX bytes:19785 (19.7 KB)

If all went well, our inet addr should now match our desire static IP!


Now getting Pi-hole on the rest of the way is easy!
Code:
curl -L install.pi-hole.net | bash

It will take a few as it downloads and installs necessary packages, it will get made that PHP5 packages aren't available but we already install PHP7 so it seems to work for me! 
Just follow all the prompts, I left the network interface stuff alone since we already configured that and once the installer finishes, it should be ready to go!

Next you'll need to change the DNS server your computer or device is using to the IP you set for your Pi-hole (192.168.1.240 for me).

Then to access the Web Control Interface, point your browser to

http://192.168.1.240/admin/index.php

You should get a page similar to mine

[Image: pinehole.jpg]

Let me know if this helps anybody out!  If you have problems, I'll do my best to help troubleshoot but am no means an expert on this!
  Reply
#2
I tried this on my pine64. I have issues when devices reach out to pi-hole for dns queries. I mean when i run from the pine-64 it works fine but when I try to access from a different device it doesn't work.

I tried to nslookup and this is what i get:

C:\Users\curiousgally>nslookup -debug www.google.com
DNS request timed out.
timeout was 2 seconds.
timeout (2 secs)
Server: UnKnown
Address: 192.168.1.11

DNS request timed out.
timeout was 2 seconds.
timeout (2 secs)
DNS request timed out.
timeout was 2 seconds.
timeout (2 secs)
DNS request timed out.
timeout was 2 seconds.
timeout (2 secs)
DNS request timed out.

192.168.1.11 is my pine-64 ip address i have used in pi-hole configuration. I have setup dns address in my router to the same. So windows is able to see it as dns end point through router..but not getting any response.

On my pine-64 netstat gives the following:

[email protected]:~$ netstat -anlp | grep -w LISTEN
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8920 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8096 0.0.0.0:* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::53 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN


Wondering why other machines not getting dns response from pi-hole.

Any help is appreciated.

Thanks.
  Reply
#3
I finally got this working, I think. But now there is a "dummy" adapter listed. I never heard of them before today so I'm Googleing. Is there anything wrong with leaving it alone? I'm just happy it's working so I'll leave it be if it doesn't lag or anything.
  Reply
#4
If it ain't broke, fix it until it is.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#5
Try removing dhcpcd5 after the install.  It has been known to cause DNS lookup issues with piHole on Debain based systems.  piHole will run just fine without it except for the DHCP server.  You will have to remove this every time you upgrade piHole too.

Code:
sudo apt remove dhcpcd5
  Reply
#6
(01-05-2017, 08:21 PM)chadbhowell Wrote: Try removing dhcpcd5 after the install...

Just an update, I switched to my odroid-c2 but same setup and removed dhcpcd5 as suggested and that seems to have done the trick.

still had to change "dev" to the actual ip address in the setup wizzard (curl ...) but no dummy adapter now.

thanks for the tips. the official pi-hole installer is making progress every day it seems. was happy to donate toward the project. I have a netgear x10, a $500 router with terrible dhcp support, this pi-hole project is doing a great job filling in the gaps in my network.
  Reply
#7
Hi, one of the Pi-hole developers here. dhcpcd5 is a vestigial package that we brought over from the Other platform that we started out on. If you set your static IP address the way most of the distributions do, via /etc/network/interfaces, then you can remove the dhcpcd5 client daemon and things should run just as well as stock. If you have any other questions or problems please let me know and well work on getting them solved. We do plan on removing the dhcpcd5 package as a dependency on platforms that don't require it, but there is no firm date for that resolution.

Thanks!
  Reply
#8
Hey all, 

I'm trying to set this up on my pine running longsleep's 16.04 image. It never jumps to the installer. 

Code:
[email protected]:~$ sudo su
[email protected]:/home/s# sudo curl -L 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
100 42644  100 42644    0     0  65512      0 --:--:-- --:--:-- --:--:--  355k
:::
::: You are root.
::: Verifying free disk space...
:::
::: Updating local cache of available [email protected]:/home/s#


I installed PHP7 per the instructions above but it didn't seem to do anything. Any ideas?

Thanks!
S
  Reply
#9
(01-20-2017, 10:26 AM)auger Wrote:
Code:
::: You are root.
::: Verifying free disk space...
:::
::: Updating local cache of available [email protected]:/home/s#

Try running:
Code:
curl -L install.pi-hole.net | sudo bash -x



That will at least show you the command that the installer script failed out at. It's run as `set -e` so that it will stop on a failure. The place it looks to be failing is at the `apt-get update` process part of the script.
  Reply
#10
(01-20-2017, 08:54 PM)DanSchaper Wrote:
(01-20-2017, 10:26 AM)auger Wrote:
Code:
::: You are root.
::: Verifying free disk space...
:::
::: Updating local cache of available [email protected]:/home/s#

Try running:
Code:
curl -L install.pi-hole.net | sudo bash -x



That will at least show you the command that the installer script failed out at. It's run as `set -e` so that it will stop on a failure. The place it looks to be failing is at the `apt-get update` process part of the script.

Thanks. It does indeed look like it's failing at the update. 

Code:
sudo curl -L install.pi-hole.net | sudo bash -x
[sudo] password for s:
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0+ set -e
+ tmpLog=/tmp/pihole-install.log
+ instalLogLoc=/etc/pihole/install.log
+ setupVars=/etc/pihole/setupVars.conf
+ lighttpdConfig=/etc/lighttpd/lighttpd.conf
+ webInterfaceGitUrl=https://github.com/pi-hole/AdminLTE.git
+ webInterfaceDir=/var/www/html/admin
+ piholeGitUrl=https://github.com/pi-hole/pi-hole.git
+ PI_HOLE_LOCAL_REPO=/etc/.pihole
+ PI_HOLE_FILES=(chronometer list piholeDebug piholeLogFlush setupLCD update version)
+ useUpdateVars=false
+ IPV4_ADDRESS=
+ IPV6_ADDRESS=
+ QUERY_LOGGING=true
++ stty size
++ echo 24 80
+ screen_size='24 80'
++ echo '24 80'
++ awk '{print $1}'
+ rows=24
++ echo '24 80'
++ awk '{print $2}'
+ columns=80
+ r=12
+ c=40
+ r=20
+ c=70
+ skipSpaceCheck=false
+ reconfigure=false
+ runUnattended=false
+ command -v apt-get
+ PKG_MANAGER=apt-get
+ UPDATE_PKG_CACHE='apt-get update'
+ PKG_INSTALL='apt-get --yes --no-install-recommends install'
+ PKG_COUNT='apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst || true'
+ apt-get install --dry-run iproute2
100 42644  100 42644    0     0  22652      0  0:00:01  0:00:01 --:--:-- 44099
+ IPROUTE_PKG=iproute2
+ apt-get install --dry-run php
+ phpVer=php
+ INSTALLER_DEPS=(apt-utils debconf dhcpcd5 git whiptail)
+ PIHOLE_DEPS=(bc cron curl dnsmasq dnsutils ${IPROUTE_PKG} iputils-ping lighttpd lsof netcat ${phpVer}-common ${phpVer}-cgi sudo unzip wget)
+ LIGHTTPD_USER=www-data
+ LIGHTTPD_GROUP=www-data
+ LIGHTTPD_CFG=lighttpd.conf.debian
+ DNSMASQ_USER=dnsmasq
+ [[ '' != true ]]
+ main
+ echo :::
:::
+ [[ 0 -eq 0 ]]
+ echo '::: You are root.'
::: You are root.
+ [[ -f /etc/pihole/setupVars.conf ]]
+ [[ false == true ]]
+ verifyFreeDiskSpace
+ echo '::: Verifying free disk space...'
::: Verifying free disk space...
+ local required_free_kilobytes=51200
++ df -Pk
++ grep -m1 '\/$'
++ awk '{print $4}'
df: /mnt/usbhdd2: Transport endpoint is not connected
+ local existing_free_kilobytes=8223152
+ [[ 8223152 =~ ^([0-9])+$ ]]
+ [[ 8223152 -lt 51200 ]]
+ update_pacakge_cache
+ echo :::
:::
+ echo -n '::: Updating local cache of available packages...'
::: Updating local cache of available packages...+ apt-get update
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Successful build on arm64 pine a64 1GB on armbian alladinrouteme 1 182 09-23-2019, 03:30 AM
Last Post: cr2016
  Pine hangs up on boot if I add my exFAT USB drive to /etc/fstab pqueiro 0 345 06-10-2019, 12:07 PM
Last Post: pqueiro
  Pine Board using linux stuck during boot sequence ktaragorn 0 133 03-23-2019, 04:06 AM
Last Post: ktaragorn
  Xenial Minimal Image (PINE A64(+)) 0.6.2-77 pineadmin 3 6,011 01-14-2019, 01:46 PM
Last Post: brigmohan
  PINE A64 upgrade to 18.04 possible? RandomUser324 4 1,851 11-29-2018, 11:46 PM
Last Post: tllim
  Xenial Minimal Image (PINE A64(+)) 0.5.5-65 pineadmin 0 1,978 06-15-2017, 12:37 AM
Last Post: pineadmin
  Xenial Minimal Image (PINE A64(+)) 0.5.2-59 pineadmin 0 1,683 05-25-2017, 09:27 AM
Last Post: pineadmin
  Unable to start Pine Topgun505 16 2,208 11-13-2016, 12:01 AM
Last Post: Gnx
  Problem with Pine honkimonk1 1 655 10-11-2016, 09:03 AM
Last Post: Luke
  Low Transfer Speeds from Pine Samba Server preimmortal 3 733 05-16-2016, 12:12 AM
Last Post: ebclr

Forum Jump:


Users browsing this thread: 1 Guest(s)