Deploy OpenFlare DNS
OpenFlare DNS (openflare-dns) is the standalone Rust authoritative DNS node for SmartDNS, supporting Linux amd64/arm64 hosts and Docker containers. For scheduling internals and ECS scoring, see SmartDNS System Architecture Design; for console setup, see SmartDNS Guide.
Prerequisites
- Control plane reachability: Outbound HTTPS access to OpenFlare Server.
- Inbound ports:
53/udpand53/tcpon Linux hosts; containers listen on5353internally and map to host port53(or use--network hostwith--listen 0.0.0.0:53). - Authentication token: Copy a prefilled command from DNS > SmartDNS > Authoritative Instances using either a
discoverytoken or a pre-registeredinstancetoken.
Linux host installation
Installer commands
Install the stable channel using a discovery token (append canary for preview builds):
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/install-openflare-dns.sh -o install-openflare-dns.sh && \
sudo bash install-openflare-dns.sh \
--controller-url https://panel.example.com \
--discovery-token '<DISCOVERY_TOKEN>' \
--public-addr 203.0.113.53 \
--listen 0.0.0.0:53For a pre-registered instance, pass --token-type instance --token '<ACCESS_TOKEN>' --instance-id '<INSTANCE_ID>'.
Installer options
| Option | Description | Default |
|---|---|---|
canary / --canary / --channel | Release channel (stable or canary) | stable |
--controller-url | OpenFlare control plane URL (required) | None |
--discovery-token / --token / --token-file | Discovery token, instance token, or token file path | None |
--token-type | Token type: discovery or instance | discovery |
--instance-id / --name | Explicit instance ID and display name | Auto-generated |
--public-addr | Public IP or hostname announced by the node | None |
--listen | UDP and TCP listen address | 0.0.0.0:53 |
--workers | SO_REUSEPORT UDP worker thread count (0 for auto-detect) | 0 |
--version | Specific dns-v* release tag (exclusive with canary) | Latest stable |
--install-dir / --state-dir / --geoip-dir | Binary, state, and GeoIP MMDB directories | /opt/openflare-dns, /var/lib/openflare-dns, <state-dir>/geoip |
--skip-geoip / --no-service | Skip GeoIP download or systemd unit creation | false |
Enable remote console updates
Fresh installations register openflare-dns-update.path and openflare-dns-update.service. On older Linux hosts, run the updater with --enable-remote to allow single or batch upgrades from the console:
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/update-openflare-dns.sh -o update-openflare-dns.sh
sudo bash update-openflare-dns.sh --enable-remote
sudo systemctl restart openflare-dnsDocker container deployment
Run ghcr.io/rain-kl/openflare-dns (:latest or :canary):
docker run -d --name openflare-dns --restart unless-stopped \
-p 53:5353/udp \
-p 53:5353/tcp \
-e OPENFLARE_DNS_CONTROLLER_URL=https://panel.example.com \
-e OPENFLARE_DNS_DISCOVERY_TOKEN='<DISCOVERY_TOKEN>' \
-e OPENFLARE_DNS_PUBLIC_ADDR=203.0.113.53 \
-v openflare_dns_data:/var/lib/openflare-dns \
ghcr.io/rain-kl/openflare-dns:latestWith the repository root docker-compose.yaml, export these variables and run docker compose up -d dns. Full container environment variables are listed in Configuration Reference.
Verification and uninstallation
Verify service status and authoritative (aa) responses:
sudo systemctl status openflare-dns
dig @203.0.113.53 sdns.example.com NS +norecurseUninstall the systemd service and binary (append --remove-state to remove credentials, snapshots, and GeoIP data):
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/uninstall-openflare-dns.sh | sudo bashFor upgrades and rollbacks, see Upgrades & maintenance.