Skip to Content
OpenFlare
GuidesDeploymentReferenceArchitectureChangelog

SmartDNS

Route A and AAAA answers based on client geography, network topology, and live node capacity using embedded or standalone SmartDNS instances.

1. Deploy and Enable

  • Embedded mode (lightweight): Set smartdns.enabled: true in Server configuration (default :53) and expose 53/UDP and 53/TCP.
  • Standalone mode (production): Deploy openflare-dns on dedicated hosts via Deploy SmartDNS and register with a discovery token.

On Linux hosts running systemd-resolved, disable its stub listener before binding port 53.

2. Console Setup

  1. Open DNS > SmartDNS > Instances and confirm at least one instance is Online (check Overview for online instance count, QPS, L1 cache hit ratio, and latency charts).
  2. Under Routing policies, select a built-in preset (Smart Allocation / Capacity Load Balance) or create a custom policy.
  3. Under Delegation, enter a delegated subdomain (such as sdns.example.com) and NS hostnames (such as ns1.example.com), adjust default TTL (60s), and enable the service.

SmartDNS Overview dashboard

  1. Under DNS > DNS Resolution > Pointing groups, bind domain pointing groups to a SmartDNS policy so records route through the generated delegation CNAME:

DNS Resolution pointing groups with SmartDNS target

3. Registrar Delegation & Constraints

ConstraintRequirement
NS placementNS hostnames must live outside the delegated zone unless backed by parent-zone glue records
Site recordsPoint site domains to the delegated subdomain with a DNS-only CNAME (proxy disabled)
ProtocolsAllow both 53/UDP and 53/TCP in host firewalls and cloud security groups
Zone apexRoot domains cannot use standard CNAME without provider ALIAS/ANAME/CNAME flattening
Rollout orderVerify online instances and local query answers before adding NS records at your registrar

4. Policy Variables (Optional)

Custom Policies DAG graphs combine weights (latency, load, geo), tag weights (use_tag_weights), and filters over these variables:

VariableDescriptionExample
client.country / client.regionClient ISO 2-letter country and region"CN", "California"
client.asnClient autonomous system number4134
client.ip_familyClient IP family"v4" / "v6"
domain / qtypeQueried domain and DNS record type"www.example.com", "A"

5. Verification & Troubleshooting

Click Simulator in the SmartDNS console to test a domain and client/ECS IP and inspect the matched policy, candidate scoring trace, and selected answer IPs:

SmartDNS Decision Simulator and candidate scoring trace

You can also verify live answers from the command line:

dig @<SMARTDNS_IP> www.edge.example.com A +short
dig +trace www.edge.example.com A
SymptomCheck
Timeout / SERVFAILVerify openflare-dns is online and both 53/UDP and 53/TCP are open
NXDOMAINConfirm the delegated zone is enabled and the route or global record targets SmartDNS
Unexpected node returnedCheck GeoIP/ASN coverage for the client IP, node health, and policy filter constraints
UDP works, TCP failsOpen 53/TCP for large responses and dig +trace fallback

See Network Tools for probing data and SmartDNS Architecture Design for internals.

On this page