Using Atlas
DNS discovery
A, AAAA and SRV records for healthy instances.
The node can optionally serve DNS over UDP and TCP. Compose enables it on
127.0.0.1:5353; standalone deployments leave it disabled unless
ATLAS_DNS_ADDR is set. DNS has no authentication, so bind it only to a
private network or put an access-controlled DNS forwarder in front of it.
Queries return up to eight healthy instances, rotating the answer set across
larger pools. If none are healthy, unknown-health instances are returned.
Unhealthy and deleted instances are never returned. The default TTL is five
seconds. DNS carries no record freshness timestamp; the TTL only controls DNS
caching. Use GET /v1/services to inspect each record's updated_at value.
| Query | Result |
|---|---|
payments.atlas. A / AAAA | Matching eligible IPv4 / IPv6 addresses |
_payments._tcp.atlas. SRV | Instance targets and registered ports |
payments.eu.atlas. A | Instances in the eu region |
_payments._tcp.eu.atlas. SRV | SRV instances in the eu region |
SRV answers for IP-addressed instances include stable Atlas target names and
address glue; those target names also resolve back to the instance address.
Hostname-addressed instances use their registered hostname as the target. DNS
service names and regions must each fit one DNS label (1-63 characters); names
containing dots remain available through the HTTP API. DNS reads each node's
local registry replica; answers converge through Atlas gossip. Set
ATLAS_DNS_ADDR=0.0.0.0:5353,
ATLAS_DNS_ZONE=atlas, and ATLAS_DNS_TTL=5s to enable it. Applications can
use a custom DNS port by pointing a resolver or CoreDNS forward rule at Atlas.