Pihole not working on its dedicated machine

  • Expected behavior
    Pihole blocks adds

  • Actual behavior
    Pihole does not block any ads

I have pihole installed in an old laptop that runs on ubuntu 18.04. The laptop currently sees ads and I can't seem to find the reason why. I haven't tried using pihole on other devices yet because I can't seem to get it running on its dedicated device.

debug token: https://tricorder.pi-hole.net/Mo8BtCRw/

my dhcpcd.conf file

 
interface wlo1
  static ip_address=192.168.2.151/24
  static routers=192.168.2.1
  static domain_name_servers=127.0.0.1
 
denyinterfaces wlo1

my setupVars.conf

WEBPASSWORD=not sure if I should share this
PIHOLE_INTERFACE=wlo1
IPV4_ADDRESS=192.168.2.151/24
IPV6_ADDRESS=
PIHOLE_DNS_1=8.8.8.8
PIHOLE_DNS_2=8.8.4.4
QUERY_LOGGING=true
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
LIGHTTPD_ENABLED=true
CACHE_SIZE=10000
DNS_FQDN_REQUIRED=true
DNS_BOGUS_PRIV=true
DNSMASQ_LISTENING=local

Any help greatly appreciated.

edit: nslookup pi.hole gives this

Server:             127.0.0.53
Address:          127.0.0.53#53

Non-authoritative answer:
*** Can't find pi.hole: No answer

Most likely another DNS stub resolver is already running on your Ubuntu release.
You can see which one with below:

sudo netstat -nltup | grep 'Proto\|:53 '

If the netstat command is not available because its depreciated, you can try run below one:

sudo ss -nltup | grep 'Netid\|:53 '

If above ones dont show the pihole-FTL daemon listening on ports 53 TCP & UDP, you would need to find a way to kill the daemon thats listening now so pihole-FTL can take its place.

pi@ph5b:~ $ sudo netstat -nltup | grep 'Proto\|:53 '
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      12289/pihole-FTL
tcp6       0      0 :::53                   :::*                    LISTEN      12289/pihole-FTL
udp        0      0 0.0.0.0:53              0.0.0.0:*                           12289/pihole-FTL
udp6       0      0 :::53                   :::*                                12289/pihole-FTL
pi@ph5b:~ $ sudo ss -nltup | grep 'Netid\|:53 '
Netid State  Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
udp   UNCONN 0      0            0.0.0.0:53        0.0.0.0:*    users:(("pihole-FTL",pid=12289,fd=4))
udp   UNCONN 0      0                  *:53              *:*    users:(("pihole-FTL",pid=12289,fd=6))
tcp   LISTEN 0      32           0.0.0.0:53        0.0.0.0:*    users:(("pihole-FTL",pid=12289,fd=5))
tcp   LISTEN 0      32              [::]:53           [::]:*    users:(("pihole-FTL",pid=12289,fd=7))
*** [ DIAGNOSING ]: Ports in use
[✓] udp:0.0.0.0:53 is in use by pihole-FTL
    udp:0.0.0.0:631 is in use by cups-browsed
    udp:0.0.0.0:5353 is in use by avahi-daemon
    udp:0.0.0.0:52682 is in use by avahi-daemon
[✓] udp:[::]:53 is in use by pihole-FTL
    udp:[::]:47815 is in use by avahi-daemon
    udp:[::]:5353 is in use by avahi-daemon
[✓] tcp:127.0.0.1:4711 is in use by pihole-FTL
[✓] tcp:0.0.0.0:80 is in use by lighttpd
[✓] tcp:0.0.0.0:53 is in use by pihole-FTL
    tcp:127.0.0.1:631 is in use by cupsd
[✓] tcp:[::1]:4711 is in use by pihole-FTL
[✓] tcp:[::]:80 is in use by lighttpd
[✓] tcp:[::]:53 is in use by pihole-FTL
    tcp:[::1]:631 is in use by cupsd
   [2022-07-06 13:26:03.743 20717M] Imported 16594 queries from the long-term database
   [2022-07-06 13:26:03.743 20717M]  -> Total DNS queries: 16594
   [2022-07-06 13:26:03.743 20717M]  -> Cached DNS queries: 8121
   [2022-07-06 13:26:03.743 20717M]  -> Forwarded DNS queries: 4260
   [2022-07-06 13:26:03.743 20717M]  -> Blocked DNS queries: 2644
   [2022-07-06 13:26:03.743 20717M]  -> Unknown DNS queries: 1265
   [2022-07-06 13:26:03.743 20717M]  -> Unique domains: 471
   [2022-07-06 13:26:03.743 20717M]  -> Unique clients: 10
lrwxrwxrwx 1 root root 39 ΔΔÎș   3  2018 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
   nameserver 8.8.8.8

thanks for your replies. I finally managed to get it working on its dedicated device.
Here's the new token : https://tricorder.pi-hole.net/04JRR8hN/
Unfortunately, I am not able to get my PC connected to the pi.

nslookup pihole
DNS request timed out.
    timeout was 2 seconds.
Server:  UnKnown
Address:  192.168.2.151

I can't even ping it

Pinging 192.168.2.151 with 32 bytes of data:
Reply from 192.168.2.2: Destination host unreachable.
Reply from 192.168.2.2: Destination host unreachable.
Reply from 192.168.2.2: Destination host unreachable.
Reply from 192.168.2.2: Destination host unreachable.

Ping statistics for 192.168.2.151:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

I should probably mention that both my pihole device and my PC are connected to the router via wifi.
Also, I've just checked my router settings and there is no AP isolation selected. That seems strange though, because I cannot ping any devices connected to the router at all.

@yubiuser , thats weird if the resolv.conf symlink is still active provided by systemd-resolved:

pi@ph5b:~ $ man systemd-resolved
[..]
       ‱   Additionally, systemd-resolved provides a local DNS stub listener
           on IP address 127.0.0.53 on the local loopback interface. Programs
           issuing DNS requests directly, bypassing any local API may be
           directed to this stub, in order to connect them to
           systemd-resolved. Note however that it is strongly recommended that
           local programs use the glibc NSS or bus APIs instead (as described
           above), as various network resolution concepts (such as link-local
           addressing, or LLMNR Unicode domains) cannot be mapped to the
           unicast DNS protocol.
[..]
To improve compatibility,
       /etc/resolv.conf is read in order to discover configured system DNS
       servers, but only if it is not a symlink to
       /run/systemd/resolve/stub-resolv.conf, /usr/lib/systemd/resolv.conf or
       /run/systemd/resolve/resolv.conf (see below).
[..]
       ‱   systemd-resolved maintains the
           /run/systemd/resolve/stub-resolv.conf file for compatibility with
           traditional Linux programs. This file may be symlinked from
           /etc/resolv.conf. This file lists the 127.0.0.53 DNS stub (see
           above) as the only DNS server. It also contains a list of search
           domains that are in use by systemd-resolved. The list of search
           domains is always kept up-to-date. Note that
           /run/systemd/resolve/stub-resolv.conf should not be used directly
           by applications, but only through a symlink from /etc/resolv.conf.
           This file may be symlinked from /etc/resolv.conf in order to
           connect all local clients that bypass local DNS APIs to
           systemd-resolved with correct search domains settings. This mode of
           operation is recommended.

And the systemd-resolved daemon isn't listed in the ss/ports list output.
Shouldnt the installer have taken care of that?

pi@ph5b:~ $ curl -sSL install.pi-hole.net | grep systemd-resolved -B3 -A10

# Systemd-resolved's DNSStubListener and dnsmasq can't share port 53.
disable_resolved_stublistener() {
    printf "  %b Testing if systemd-resolved is enabled\\n" "${INFO}"
    # Check if Systemd-resolved's DNSStubListener is enabled and active on port 53
    if check_service_active "systemd-resolved"; then
        # Check if DNSStubListener is enabled
        printf "  %b  %b Testing if systemd-resolved DNSStub-Listener is active" "${OVER}" "${INFO}"
        if ( grep -E '#?DNSStubListener=yes' /etc/systemd/resolved.conf &> /dev/null ); then
            # Disable the DNSStubListener to unbind it from port 53
            # Note that this breaks dns functionality on host until dnsmasq/ftl are up and running
            printf "%b  %b Disabling systemd-resolved DNSStubListener" "${OVER}" "${TICK}"
            # Make a backup of the original /etc/systemd/resolved.conf
            # (This will need to be restored on uninstallation)
            sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
            printf " and restarting systemd-resolved\\n"
            systemctl reload-or-restart systemd-resolved
        else
            printf "%b  %b Systemd-resolved does not need to be restarted\\n" "${OVER}" "${INFO}"
        fi
    else
        printf "%b  %b Systemd-resolved is not enabled\\n" "${OVER}" "${INFO}"
    fi
}

@gk2803 , what does below one output after you restore connectivity?

pi@ph5b:~ $ systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
[..]

EDIT: Ow and what does below one output?

grep DNSStubListener= /etc/systemd/resolved.conf

It should

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.