Cloudflared and Pi-Hole issues


#1

I have used Pi-Hole for a while and decided to try to move my DNS lookups to DoH; Cloudflared seemed the simplest way.

Having set it up I noticed that none of the queries were being cached. To cut a long story short, I had used the local IP address in the resolver setup rather than 127.0.0.1.

netstat shows that cloudflared is setup to only listen to 127.0.0.1. Is this deliberate? I am no expert in this, but it seems that if it listened on 0.0.0.0 then I would have been able to connect using a local IP address.

[email protected]:~# netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:5053          0.0.0.0:*               LISTEN      1982/cloudflared
tcp        0      0 127.0.0.1:4711          0.0.0.0:*               LISTEN      49613/pihole-FTL
tcp        0      0 127.0.0.1:38319         0.0.0.0:*               LISTEN      1982/cloudflared
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      812/lighttpd
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      49613/pihole-FTL
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      558/dropbear
tcp6       0      0 ::1:4711                :::*                    LISTEN      49613/pihole-FTL
tcp6       0      0 :::80                   :::*                    LISTEN      812/lighttpd
tcp6       0      0 :::53                   :::*                    LISTEN      49613/pihole-FTL
tcp6       0      0 :::22                   :::*                    LISTEN      558/dropbear
udp        0      0 127.0.0.1:5053          0.0.0.0:*                           1982/cloudflared
udp        0      0 0.0.0.0:53              0.0.0.0:*                           49613/pihole-FTL
udp        0      0 0.0.0.0:59549           0.0.0.0:*                           1139/avahi-daemon:
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           1139/avahi-daemon:
udp6       0      0 :::44505                :::*                                1139/avahi-daemon:
udp6       0      0 :::53                   :::*                                49613/pihole-FTL
udp6       0      0 :::5353                 :::*                                1139/avahi-daemon:

Can someone also explain the message "Starting metrics server" addr="127.0.0.1:40199 in the log and also why cloudflared is listening on port 38319 please.


#2

Can anyone explain this?