← RESEARCH
LAB / 2026.05 DNS RESEARCH

GEO-Weighted DNS

Internal GSLB for CDN/Edge: geographic + weighted DNS routing via k8gb, integrated with the existing PowerDNS. Research (2026-05-23), Phase 1 pending.

k8gbPowerDNSMaxMind GeoLite2

Why

A CDN/Edge footprint spans several PoPs across distinct geographies — two regions (HN and HCM) plus overseas partners — but the authoritative DNS for *.example.net returns the same RRset to every resolver regardless of location. A user in the southern region can be routed to the northern PoP, adding 30–60ms of unnecessary RTT across millions of requests per day.

The existing DNS plane is PowerDNS authoritative. Plain DNS (RFC 1035) has no notion of answering by location, by weight, or by backend health. Traffic cannot be shifted between PoPs — draining a PoP for maintenance means shutting down the service or announcing far in advance. When a PoP goes down, the record keeps returning its IP until an operator edits the zone by hand and the TTL expires, stretching outages to 5–30 minutes.

Anycast would solve the geographic problem but demands BGP peering, an ASN, and dedicated IP space — overkill at this stage. This research designs a GSLB (Global Server Load Balancing) layer that adds geographic routing, weighted traffic shifting, and health-driven failover on top of the DNS infrastructure already in place.

Scope

  • GSLB routing that supports GEO-based and weighted resolution simultaneously, serving the CDN/Edge use case first.
  • Coexistence with the current PowerDNS authoritative for example.net: delegate only the gslb.example.net subzone, leaving the main zone untouched for safe rollback.
  • Deployable on existing Kubernetes clusters (HN + HCM) and operable by a team of one to two people.
  • Candidate evaluation across k8gb, PowerDNS GeoIP backend, CoreDNS plugins, BIND9 views, Polaris, and managed services (Route 53 / NS1).
  • Boundary: building a bespoke authoritative DNS server is out of scope — the security surface (amplification, DNSSEC) is not worth the maintenance cost.

Problems & Solutions

Location-blind answers

A single answer set for every resolver sends distant users to the wrong PoP. The design uses k8gb with strategy: geoip, resolving against a MaxMind GeoLite2 database that maps Vietnamese IP ranges to the HN or HCM cluster. Geographic precision depends on EDNS Client Subnet (RFC 7871): resolver-IP geolocation misroutes when a client uses a distant public resolver, while ECS carries the client’s /24 so the authoritative sees the real approximate location.

No weighted distribution

Round-robin DNS gives every answer equal weight — there is no way to express 70/30. k8gb’s weighted strategy distributes queries by configured weight for canary, A/B, and gradual rollout, and drains a PoP by lowering its weight to zero. Geographic routing selects the region; weighted routing balances cache nodes within it.

Manual failover

Without DNS-integrated health checks, a downed PoP keeps receiving traffic. k8gb reads Ingress reachability as a built-in health signal and removes unhealthy IPs from the answer set. With TTL kept low (30–60s), failover completes in under 60 seconds instead of requiring a hand edit.

Split-brain across clusters

When each cluster runs its own k8gb instance, a network partition can make them disagree about which backends are healthy. k8gb resolves this with an EdgeDNS coordinator: each instance writes its health state into a shared DNS zone (edge.gslb.example.net) that all instances read, producing one consistent view. The coordinator runs on the existing PowerDNS via its API, avoiding a new vendor; managed Route 53 stays as a fallback if the PowerDNS provider proves unstable.

Architecture

GeoDNS U Internet end users HN / HCM R Recursive resolver Google / ISP · sends ECS U->R P PowerDNS authoritative existing · example.net R->P cdn.example.net HN k8gb · Cluster HN geoip + weighted P->HN NS delegation gslb.example.net HCM k8gb · Cluster HCM geoip + weighted P->HCM NS delegation gslb.example.net HN->HCM EdgeDNS coordinator edge.gslb.example.net PHN Edge/CDN PoP HN cache-1, cache-2 HN->PHN PHCM Edge/CDN PoP HCM cache-3, cache-4 HCM->PHCM

Public names such as cdn.example.net CNAME to cdn.gslb.example.net, so the user-facing name never changes. Inter-region selection (HN vs HCM) runs on GeoIP; intra-region balancing (cache-1 vs cache-2) runs on weighted routing with health checks; a cross-region failover strategy serves the surviving region if an entire region goes down.

Decision

Current decision: k8gb is the leading candidate. It expresses GEO and weighted strategies together, reads Ingress reachability as a native health signal, and deploys on the existing HN/HCM Kubernetes clusters without introducing a new DNS vendor — while the gslb.example.net delegation keeps the main PowerDNS zone untouched for rollback. Phase 1 validation on the two clusters remains pending.