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


#12

Check your /etc/dnsmasq.conf file. There should be only one kine pointing to the /etc/dnsmasq.d… directory.


#13

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

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


#14

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?

=]


#15

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


#16

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…


#17

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


#18

backpain-1292835351

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

Thanks a ton!


#19

That and the dnsmasq daemon still running.

Cheers!!!


#20

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


#21

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

=]


#22

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>


#23

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.

=]


#24

Below ones might give some info:

sudo service pihole-FTL status -l

sudo service lighttpd status -l


#25
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?


#26

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


#27
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

====


#28

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


#29

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

====


#30

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


#31

debian@beaglebone:~$ sudo ss -nlutp
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 0 0 :53 : users:((“pihole-FTL”,pid=1432,fd=6))
udp UNCONN 0 0 :67 : users:((“pihole-FTL”,pid=1432,fd=4))
udp UNCONN 0 0 :68 : users:((“dhcpcd”,pid=1297,fd=10))
udp UNCONN 0 0 :58449 : users:((“avahi-daemon”,pid=1026,fd=14))
udp UNCONN 0 0 :5353 : users:((“avahi-daemon”,pid=1026,fd=12))
udp UNCONN 0 0 :::546 :::
users:((“dhcpcd”,pid=1297,fd=14))
udp UNCONN 0 0 :::53 :::
users:((“pihole-FTL”,pid=1432,fd=8))
udp UNCONN 0 0 :::34152 :::
users:((“avahi-daemon”,pid=1026,fd=15))
udp UNCONN 0 0 :::5353 :::
users:((“avahi-daemon”,pid=1026,fd=13))
tcp LISTEN 0 32 :53 : users:((“pihole-FTL”,pid=1432,fd=7))
tcp LISTEN 0 128 :22 : users:((“sshd”,pid=1264,fd=3))
tcp LISTEN 0 5 127.0.0.1:4711 : users:((“pihole-FTL”,pid=1432,fd=12))
tcp LISTEN 0 128 :::8080 :::
users:((“apache2”,pid=1345,fd=4),(“apache2”,pid=1344,fd=4),(“apache2”,pid=1336,fd=4))
tcp LISTEN 0 32 :::53 :::
users:((“pihole-FTL”,pid=1432,fd=9))
tcp LISTEN 0 128 :::22 :::
users:((“sshd”,pid=1264,fd=4))
tcp LISTEN 0 128 :::1880 :::* users:((“systemd”,pid=1,fd=49))
tcp LISTEN 0 128 :::3000 :::* users:((“systemd”,pid=1,fd=47))
tcp LISTEN 0 5 ::1:4711 :::* users:((“pihole-FTL”,pid=1432,fd=13))

====