DNS-Over-HTTPS on Pi-hole (cloudflared setup on Ubuntu)

I’ve been running Pi-hole with DNS-Over-HTTPS using Cloudflare’s DoH client (cloudflared) for some time now; I followed the guide posted here on the official Pi-hole documentation site. When updating the cloudflared recently, I noticed it displayed some errors when the service tried to start up. After digging around, I found that cloudflared now has an option to install itself as a service whereas the guide I used includes steps for creating the service manually. Thus, I believe this is a simpler way to setup cloudflared as your DNS-Over-HTTPS client for Pi-hole.

Download the cloudflared daemon and install it:

Create a folder and config file for the cloudflared daemon:

Use the following command to instruct cloudflared to install itself as service:

Start the new cloudflared service and check the status:

You should get output similar to the following if successful:

Now just configure Pi-hole to use cloudflared as the DNS resolver: