Unable to get CF to connect or create a listener

Hello everyone, I am using 2 Pi Zero Ws as my two PiHoles with Cloudflared running through them as the default DNS but I keep running into issues. First I had the following chunk of error messages:

Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a
Aug 25 16:57:52 RPI0-Black Cloudflared[268]: time="2019-08-25T16:57:52+01:00" level=error msg="failed to connect to a

I then found THIS topic and tried adding that in my service but then I get this message when I check the status of CF:

Aug 25 17:04:04 RPI0-Black systemd[1]: Started Cloudflared DNS over HTTPS proxy.
Aug 25 17:04:05 RPI0-Black Cloudflared[7373]: time="2019-08-25T17:04:05+01:00" level=info msg="Adding DNS upstream" url="https://1.1.1.1/dns-query"
Aug 25 17:04:05 RPI0-Black Cloudflared[7373]: time="2019-08-25T17:04:05+01:00" level=info msg="Adding DNS upstream" url="https://1.0.0.1/dns-query"
Aug 25 17:04:05 RPI0-Black Cloudflared[7373]: time="2019-08-25T17:04:05+01:00" level=info msg="Starting DNS over HTTPS proxy server" addr="dns://localhost:55"
Aug 25 17:04:05 RPI0-Black Cloudflared[7373]: time="2019-08-25T17:04:05+01:00" level=error msg="Failed to start the listeners" error="failed to create a UDP listener: listen udp 127.0.0.1:55: bind: permission denied"

Am I doing something wrong? What do I need to do to fix it and get it working? I haven’t set my entire network to these pi’s yet due to it failing on my PC if I set it manually.

Running “listen udp 127.0.0.1:55: bind: permission denied” through a search engine of your choice will immediately answer that.

Sorry, but - apart from running a Cloudflare binary - that really is not Cloudflare related.

Hint: run your process with root privileges.

1 Like

Well I did find a few results but this all states that its an issue with DNSCrypt, which I am not using. Cloudflared launches via a system service which I don’t know how to specify to run as root.

From documentation:
https://developers.cloudflare.com/1.1.1.1/dns-over-https/Cloudflared-proxy/
sudo Cloudflared service install

Between what you posted and this BenDews tutorial, I was able to get it working I think. Is this with Pi-Hole the best way to protect and encrypt internet traffic besides using a VPN?

For starters, it does not “encrypt Internet traffic” but only DNS requests. Second, you cant really compare it to a VPN, particularly because DNS requests typically are still unencrypted on a VPN as well. You simply move the exit from your ISP to the VPN’s network.

There isnt really a “best way”. It all depends on your requirements. If you have one machine, I’d probably no bother with a Raspberry PI setup but configure Do* directly on that machine. If you want to provide a set of machines with encrypted DNS, it might be a good solution.

Your problem simply was that you wanted to run something on port 55 without root privileges and that is typically not possible on Unix.

2 Likes

This topic was automatically closed after 31 days. New replies are no longer allowed.