Skip to content

Instantly share code, notes, and snippets.

@mtrimarchi
Last active January 4, 2023 11:41
Show Gist options
  • Save mtrimarchi/67e4435651af6e97c9bbbe92957642ef to your computer and use it in GitHub Desktop.
Save mtrimarchi/67e4435651af6e97c9bbbe92957642ef to your computer and use it in GitHub Desktop.
Cloudflared with systemd
# /etc/default/cloudflared
CLOUDFLARED_OPTS=--port 5053 --upstream https://1.1.1.1/dns-query --upstream https://dns.google.com/resolve --upstream https://1.0.0.1/dns-query --upstream https://2606:4700:4700::1111/dns-query --upstream https://2606:4700:4700::1001/dns-query
# /lib/systemd/system/cloudflared.service
[Unit]
Description=cloudflared DNS over HTTPS proxy
After=syslog.target network-online.target
[Service]
Type=simple
User=cloudflared
EnvironmentFile=/etc/default/cloudflared
ExecStart=/usr/local/bin/cloudflared proxy-dns $CLOUDFLARED_OPTS
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment