Beaglebone - ads not being blocked (I searched the forums!)

Hi again, thanks for your continued support.

I removed dnsmasq, ran pihole repair and rebooted the machine. Pihole still says it's not running. New debug log here:

[✓] Your debug token is: t1g9a1nhyf

For what it's worth, I'm running the latest standard Beaglebone image.

=]

One more thing: when I run repair, or after the install procedure, I have to comment a line ina config file:

dnsmasq: illegal repeated keyword at line 35 of /etc/dnsmasq.d/01-pihole.conf:

#cache-size=10000

That solved the DNS issue a while back but no longer.

And check for alien dnsmasq config files not belonging to Pi-hole:

sudo grep -v '#\|^$' -R /etc/dnsmasq.*

1 Like

Here's what I see in /etc/dnsmasq.conf:

# Include another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
conf-dir=/etc/dnsmasq.d

# Include all the files in a directory except those ending in .bak
#conf-dir=/etc/dnsmasq.d,.bak

# Include all files in a directory which end in .conf
#conf-dir=/etc/dnsmasq.d/,*.conf

The alien check shows this:

/etc/dnsmasq.conf:conf-dir=/etc/dnsmasq.d
/etc/dnsmasq.d/SoftAp0:interface=usb0
/etc/dnsmasq.d/SoftAp0:interface=usb1
/etc/dnsmasq.d/SoftAp0:port=53
/etc/dnsmasq.d/SoftAp0:dhcp-authoritative
/etc/dnsmasq.d/SoftAp0:domain-needed
/etc/dnsmasq.d/SoftAp0:bogus-priv
/etc/dnsmasq.d/SoftAp0:expand-hosts
/etc/dnsmasq.d/SoftAp0:cache-size=2048
/etc/dnsmasq.d/SoftAp0:dhcp-range=usb0,192.168.7.1,192.168.7.1,2m
/etc/dnsmasq.d/SoftAp0:dhcp-range=usb1,192.168.6.1,192.168.6.1,2m
/etc/dnsmasq.d/SoftAp0:listen-address=127.0.0.1
/etc/dnsmasq.d/SoftAp0:listen-address=192.168.7.2
/etc/dnsmasq.d/SoftAp0:listen-address=192.168.6.2
/etc/dnsmasq.d/SoftAp0:dhcp-option=usb0,3
/etc/dnsmasq.d/SoftAp0:dhcp-option=usb0,6
/etc/dnsmasq.d/SoftAp0:dhcp-option=usb1,3
/etc/dnsmasq.d/SoftAp0:dhcp-option=usb1,6
/etc/dnsmasq.d/SoftAp0:dhcp-leasefile=/var/run/dnsmasq.leases
/etc/dnsmasq.d/01-pihole.conf:addn-hosts=/etc/pihole/gravity.list
/etc/dnsmasq.d/01-pihole.conf:addn-hosts=/etc/pihole/black.list
/etc/dnsmasq.d/01-pihole.conf:addn-hosts=/etc/pihole/local.list
/etc/dnsmasq.d/01-pihole.conf:localise-queries
/etc/dnsmasq.d/01-pihole.conf:no-resolv
/etc/dnsmasq.d/01-pihole.conf:log-queries=extra
/etc/dnsmasq.d/01-pihole.conf:log-facility=/var/log/pihole.log
/etc/dnsmasq.d/01-pihole.conf:local-ttl=2
/etc/dnsmasq.d/01-pihole.conf:log-async
/etc/dnsmasq.d/01-pihole.conf:server=8.8.8.8
/etc/dnsmasq.d/01-pihole.conf:server=8.8.4.4
/etc/dnsmasq.d/01-pihole.conf:interface=eth0

What does this mean?

=]

Move that alien SoftAp0 file to your home folder:

sudo mv /etc/dnsmasq.d/SoftAp0 ~

Restart:

sudo service pihole-FTL restart

Check status:

sudo service pihole-FTL status -l

pihole status

And try do a DNS lookup:

host pi.hole localhost

1 Like

Hi guys,

pihole-FTL status check shows:

ebian@beaglebone:~$ sudo service pihole-FTL status -l
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated; vendor preset: enabled)
   Active: active (exited) since Sun 2018-11-25 23:01:31 UTC; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3178 ExecStop=/etc/init.d/pihole-FTL stop (code=exited, status=0/SUCCESS)
  Process: 3184 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

Nov 25 23:01:30 beaglebone systemd[1]: Starting LSB: pihole-FTL daemon...
Nov 25 23:01:30 beaglebone pihole-FTL[3184]: Not running
Nov 25 23:01:30 beaglebone pihole-FTL[3184]: chown: cannot access '/etc/pihole/dhcp.lea
Nov 25 23:01:30 beaglebone su[3207]: Successful su for pihole by root
Nov 25 23:01:30 beaglebone su[3207]: + ??? root:pihole
Nov 25 23:01:30 beaglebone su[3207]: pam_unix(su:session): session opened for user piho
Nov 25 23:01:31 beaglebone pihole-FTL[3184]: FTL started!
Nov 25 23:01:31 beaglebone systemd[1]: Started LSB: pihole-FTL daemon.

pihols status check shows:

debian@beaglebone:~$ pihole status
  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled

DNS lookup check shows:

ebian@beaglebone:~$ host pi.hole localhost
Using domain server:
Name: localhost
Address: ::1#53
Aliases:

pi.hole has address
pi.hole has IPv6 address <probably correct IP, IPv6 is weird to me>

I'll go point my router back to the pihole, brb...

Dont point your router WAN DNS .... do this pushing Pi-hole's IP to the clients for DNS via DHCP:

backpain-1292835351

It works! Man, what an ordeal. Seems to me the problem was the SoftAP definition for dnsmasq?

Thanks a ton!

1 Like

That and the dnsmasq daemon still running.

Cheers!!!

1 Like

Ah, yep that's what I meant - I added the pi-hole to my router's DHCP DNS settings.

Mmmm, ok well it was working before I rebooted. How can I get the system to run reliably upon startup?

=]

What troubles do you have now ?
Have you renewed DHCP leases on your client devices and flushed DNS cache to be sure ?
Try do a DNS lookup on one of your client PC's (Linux, Windows or MacOS):

nslookup pi.hole <PIHOLE_IP_ADDRESS>

After I rebooted, the web-admin page wouldn't load, and it looks like lighttpd was not started. I started it manually and I got the page back. However, the dashboard said "lost connection to API". Pihole status said DNS was not running. Also, ads were back.

New debug log:

[✓] Your debug token is: fs69iq793o

I didn't release/renew IPs for my client devices because I figured the above issues were fatal anyhow.

=]

Below ones might give some info:

sudo service pihole-FTL status -l

sudo service lighttpd status -l

debian@beaglebone:~$ sudo service pihole-FTL status -l
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated; vendor preset: enabled)
   Active: active (exited) since Sun 2018-11-25 23:31:06 UTC; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1067 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/pihole-FTL.service

Nov 25 23:30:56 beaglebone systemd[1]: Starting LSB: pihole-FTL daemon...
Nov 25 23:30:57 beaglebone pihole-FTL[1067]: Not running
Nov 25 23:30:58 beaglebone pihole-FTL[1067]: chown: cannot access '/etc/pihole/dhcp.lea
Nov 25 23:31:00 beaglebone pihole-FTL[1067]: /etc/resolvconf/update.d/libc: Warning: /e
Nov 25 23:31:02 beaglebone su[1308]: Successful su for pihole by root
Nov 25 23:31:05 beaglebone pihole-FTL[1067]: dnsmasq: cannot open or create lease file
Nov 25 23:31:06 beaglebone systemd[1]: Started LSB: pihole-FTL daemon.

ebian@beaglebone:~$ sudo service lighttpd status -l
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2018-11-25 23:31:41 UTC; 6min ago
  Process: 2393 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 2373 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 2393 (code=exited, status=255)

Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 25 23:31:41 beaglebone systemd[1]: Stopped Lighttpd Daemon.
Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 25 23:31:41 beaglebone systemd[1]: Failed to start Lighttpd Daemon.
Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Unit entered failed state.
Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Failed with result 'exit-code'.

What could be killing these?

Bits are cut off on that status line.
Can you post results for below one instead (after fresh reboot) ?

sudo systemctl status pihole-FTL -l

For lighttpd, can you post results for below ones ?

sudo netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:471'

sudo tail /var/log/lighttpd/error.log

debian@beaglebone:~$ sudo systemctl status pihole-FTL -l
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated; vendor preset: enabled)
   Active: active (exited) since Sun 2018-11-25 23:31:06 UTC; 13min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1067 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/pihole-FTL.service

Nov 25 23:30:56 beaglebone systemd[1]: Starting LSB: pihole-FTL daemon...
Nov 25 23:30:57 beaglebone pihole-FTL[1067]: Not running
Nov 25 23:30:58 beaglebone pihole-FTL[1067]: chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
Nov 25 23:31:00 beaglebone pihole-FTL[1067]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf
Nov 25 23:31:02 beaglebone su[1308]: Successful su for pihole by root
Nov 25 23:31:05 beaglebone pihole-FTL[1067]: dnsmasq: cannot open or create lease file /var/run/dnsmasq.leases: Permission denied
Nov 25 23:31:06 beaglebone systemd[1]: Started LSB: pihole-FTL daemon.

====

debian@beaglebone:~$ sudo netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:471'
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

====

debian@beaglebone:~$ sudo tail /var/log/lighttpd/error.log
2018-11-25 22:26:14: (server.c.1828) server stopped by UID = 0 PID = 1
2018-11-25 22:26:16: (log.c.217) server started
2018-11-25 22:26:16: (server.c.1295) WARNING: unknown config-key: alias.url (ignored)
2018-11-25 22:26:41: (server.c.1828) server stopped by UID = 0 PID = 1
2018-11-25 23:18:32: (log.c.217) server started
2018-11-25 23:18:32: (server.c.1295) WARNING: unknown config-key: alias.url (ignored)
2018-11-25 23:21:51: (server.c.1828) server stopped by UID = 0 PID = 1
2018-11-25 23:24:07: (log.c.217) server started
2018-11-25 23:24:07: (server.c.1295) WARNING: unknown config-key: alias.url (ignored)
2018-11-25 23:30:09: (server.c.1828) server stopped by UID = 0 PID = 1

====

Linux capabilities missing probably:

https://docs.pi-hole.net/ftldns/in-depth/#linux-capabilities

Try:

sudo sed -i 's/FTLUSER=pihole/FTLUSER=root/' /etc/init.d/pihole-FTL

And after reboot, check Pi-hole status again.

For lighttpd, can you try the netstat command again copying the line exactly as I posted before ?
Am missing bits.
Or if still no data displayed, try without grep:

sudo netstat -nltup

debian@beaglebone:~$ pihole status
[sudo] password for debian:
[✓] DNS service is running
[✓] Pi-hole blocking is Enabled

====

debian@beaglebone:~$ sudo netstat -nltup | grep 'Proto|:53 |:67 |:80 |:471'
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1432/pihole-FTL
tcp 0 0 127.0.0.1:4711 0.0.0.0:* LISTEN 1432/pihole-FTL
tcp6 0 0 :::80 :::* LISTEN 1/init
tcp6 0 0 :::53 :::* LISTEN 1432/pihole-FTL
tcp6 0 0 ::1:4711 :::* LISTEN 1432/pihole-FTL
udp 0 0 0.0.0.0:53 0.0.0.0:* 1432/pihole-FTL
udp 0 0 0.0.0.0:67 0.0.0.0:* 1432/pihole-FTL
udp6 0 0 :::53 :::* 1432/pihole-FTL

====

That is weird.
Looks like the init process is listening on IPv6 TCP port 80 preventing lighttpd to bind to this socket.
Never seen this before :smiley:

And below one ?

sudo ss -nlutp