Skip to content

Instantly share code, notes, and snippets.

@jwmoss
Last active December 29, 2020 17:35
Show Gist options
  • Save jwmoss/93e3ceebb0a0e38f8aa5d9d7521e396b to your computer and use it in GitHub Desktop.
Save jwmoss/93e3ceebb0a0e38f8aa5d9d7521e396b to your computer and use it in GitHub Desktop.
Cloudflared Setup

Cloudflared Setup

Requirements:

  • crazymax/cloudflared
  • pihole docker image
  • pi-hole br0 ip address, such as 192.168.1.5
  • cloudflared br0 ip adderss, such as 192.168.1.10
  1. Configure the following parameters in pihole docker image:
  • 53/TCP and 53/UDP
  • 67/UDP
  • 80/TCP
  • Configuration
    • Container path: /etc/pihole
    • Host path: /path/to/pihole
  • DNSMasq
    • Container path: /etc/dnsmasq.d
    • Host path: /path/to/pihole/dnsmasq.d
  • TZ=America/New_York
  • DNS1=192.168.1.10#5053 <-- this is the cloudflared container IP address. Yes include the #
  • DNS2=no
  • DNSMASQ_LISTENING=ALL
  • EXTRAPARAMETERS= --restart=unless-stopped
  1. Make sure extra paramters looks like this for the pihole image

  2. Make sure the settings in pi-hole looks like this. Custom DNS 1 will be your DNS1 entry from docker.

  3. Make sure the advanced DNS settings in pi-hole looks like this

  4. For the cloudflared docker image, make sure to set privileged to on. Example configuration

  5. Restart both cloudflared and pi-hole. Test by setting your mobile device to the pi-hole IP address only, such as 192.168.1.5 in our example. Then visit a website and make sure DNS resolution works.

You're welcome, Erik.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment