Skip to main content

Internal DNS Server

The DNS server provides geo-aware name resolution for .internal domains.

Usage

# Enable DNS server
export EDGEPROXY_DNS_ENABLED=true
export EDGEPROXY_DNS_LISTEN_ADDR=0.0.0.0:5353
export EDGEPROXY_DNS_DOMAIN=internal

# Query for best backend IP (geo-aware)
dig @localhost -p 5353 myapp.internal A

# Response: Best backend IP based on client location
;; ANSWER SECTION:
myapp.internal. 300 IN A 10.50.1.5

DNS Schema

DomainResolves ToExample
<app>.internalBest backend IPmyapp.internal10.50.1.5
<region>.backends.internalBackend WG IPnrt.backends.internal10.50.4.1
<region>.pops.internalPOP WG IPhkg.pops.internal10.50.5.1

Configuration

VariableDefaultDescription
EDGEPROXY_DNS_ENABLEDfalseEnable DNS server
EDGEPROXY_DNS_LISTEN_ADDR0.0.0.0:5353DNS listen address
EDGEPROXY_DNS_DOMAINinternalDNS domain suffix

Benefits

  • Abstraction: Change IPs without updating configs
  • Migration: Move backends without downtime
  • Geo-aware: Returns best backend based on client location

Integration Examples

Docker Compose

services:
app:
dns: edgeproxy
environment:
- API_HOST=backend.internal

Application Configuration

# Instead of hardcoding IPs
export BACKEND_HOST=myapp.internal

# Application resolves via edgeProxy DNS
curl http://myapp.internal:8080/api