Argo Tunnel + Pi-Hole DNS-over-HTTPS

Hi there,

I used to have two hosts, one which ran cloudflared for my Cloudflare Tunnel , and a second which ran cloudflared for my Pi-hole DNS-over-HTTPS service [*1]. Not knowing there would be a conflict, I recently migrated these two hosts to a single new host (running Ubuntu 22.04 LTS), where I was greeted with an “inactive” Cloudflare Tunnel (but working Pi-hole).

After some troubleshooting, I came across this post[*2], which helped me understand that my issue is likely that I can’t run both of these using a single cloudflared service, and I instead need to run two cloudflared services simultaneously, one configured for my tunnel, and the other configured for my Pi-hole DoH.

What’s not clear to me is the process for completing this task. After deconstructing the above-linked Pi-hole DoH walkthrough, I got as far as…

  1. Disabling the active cloudflared.service service
  2. Duplicating (and renaming) that service at /etc/systemd/system (to cloudflared-argo.service and cloudflared-pihole.service)
  3. Editing the “EnvironmentFile” variable in each of the service files in #2 to point to unique targets (/etc/default/cloudflared-argo and /etc/default/cloudflared-pihole, respectively)
  4. Renaming the existing /etc/default/cloudflared file to /etc/default/cloudflared-pihole

HOWEVER, I’m not sure what the environment file for cloudflared-argo should look like. Are the arguments the same as a typical config.yml file? Do I need one at all?

I migrated my tunnel from CLI to web-based administration months ago, so I no longer have a config.yml, and it’s not clear to me how to manually create one via the CLI (*3) if I now have two separate, concurrently-running cloudflared services, given that the associated commands all simply call “cloudflared.”

Before I attempt to enable and start my new cloudflared-argo.service and cloudflared-pihole.service services, I want to make sure I’m approaching this problem the right way. Where I could use help is:

A) Verify that this is the right approach to run both an Cloudflare Tunnel and DOH on the same host at the same time
B) Assuming a) is true, help me understand what the cloudflared-argo environment file should include
C) Help me understand how to engage with each cloudflared service via CLI if I have two such services running concurrently

Thanks so much for your help with this!


1 Like