Skip to content

Instantly share code, notes, and snippets.

@lazypwny751
Last active July 26, 2025 14:04
Show Gist options
  • Select an option

  • Save lazypwny751/2faa0dfedf4f36f7ad886fb6b37756c5 to your computer and use it in GitHub Desktop.

Select an option

Save lazypwny751/2faa0dfedf4f36f7ad886fb6b37756c5 to your computer and use it in GitHub Desktop.
Cloudflared service file for systemd.
[Unit]
Description=cloudflared DNS over HTTPS proxy
After=network.target
[Service]
ExecStart=/usr/local/bin/cloudflared --config /etc/cloudflared/config.yml
Restart=on-failure
RestartSec=5s
User=nobody
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
# sudo systemctl daemon-reexec
# sudo systemctl daemon-reload
# sudo systemctl enable cloudflared
# sudo systemctl start cloudflared
# sudo systemctl status cloudflared
# sudo iptables -t nat -A OUTPUT -p udp --dport 53 -d 127.0.0.1 -j REDIRECT --to-ports 5053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment