Skip to main content
Traffic steering decides which of a name’s A and AAAA records a client gets, for plain records (no proxy needed):
  • GeoDNS: by where the client is, its country or continent.
  • Weights: one record picked at random by weight, for canaries and uneven load.
  • Health checks: an address leaves the answers while its HTTP, HTTPS or TCP check fails (failover).
Each record has its own steering. Records of a name without steering are answered as usual.

Set it up

1

Download the GeoIP database (for GeoDNS)

As a superadmin, open Settings → General → GeoIP database and click Download. Leave Update monthly on. Weights and health checks work without it.
2

Steer a record

Open DNS → Zones, a zone, then an A or AAAA record, and click Traffic steering…. Pick the countries or continents it is for, a weight, and a health check.
3

Test the check

Test now runs the health check once without saving. After saving, a green or red dot on the record’s steering badge shows its health.

How an answer is picked

For a name whose records have steering:
  1. Health: records whose health check is failing are left out. If every checked record of the name is failing, all of them are answered, so an outage of the checker doesn’t take the name off DNS.
  2. Place: records for the client’s country are answered. If there are none, those for its continent. If there are none, the records for no place in particular (the default). Without a default, every record left after step 1 is answered.
  3. Weight: when the remaining records have weights, one of them is answered, picked at random by weight. A record without a weight counts as 1; weight 0 only answers when all are 0.
Records of the name without steering count as defaults with no check and no weight. Steering applies to local answers. CNAME chains, views and DNSSEC signing work as before (the signature covers the records actually answered), and a wildcard’s steering applies to the names it answers for. Proxied records are answered by their proxies instead, so they can’t be steered.
Keep TTLs short on steered names, 30 to 60 seconds. Resolvers cache answers for the TTL, so a failover or a weight change reaches clients only as fast as the TTL allows.

Examples

The canary from the table, from the CLI:

Where clients are

GeoDNS needs a country database in MaxMind’s .mmdb format. DNZ doesn’t ship one: download it under Settings → General → GeoIP database, or with dnz geoip download. By default that is DB-IP’s IP to Country Lite, free under CC BY 4.0 (IP Geolocation by DB-IP), refreshed monthly while Update monthly is on. DB-IP publishes a new file each month; DNZ fills {year} and {month} into the URL and falls back to the month before early in a month. Any country .mmdb works instead, for example a MaxMind GeoLite2 Country permalink with your license key:
The file is kept next to the database (geoip-country.mmdb), read at startup and replaced in place on every download. A client is placed by its own address, or by the EDNS Client Subnet (RFC 7871) a resolver sends on its behalf. The answer then carries the subnet back with that scope, so the resolver caches it for that network only. Without a database, or for private addresses, every client gets the default records. Look up on the GeoIP card shows where an address is, as GeoDNS sees it:
Countries are ISO 3166 two-letter codes (ID, SG, US, DE). Continents are:

Health checks

Checks run from the DNZ server itself, so the address must be reachable from there. Test now (or --test) runs one check without saving. The state shows:
  • next to the record in the zone, as a green or red dot on its steering badge,
  • on the topology map, as an Origin node per steered address,
  • in dnz record steering example.com.
Changes are logged by the server (health check failing: left out of DNS answers).

Removing the steering

In the dashboard, open Traffic steering… on the record and click Remove steering. The record itself stays. The API is described in Records: traffic steering and Settings: GeoIP database.