Physical Address
Metro Manila, Philippines
Physical Address
Metro Manila, Philippines
DNS can do much more than return a fixed IP address.
An authoritative DNS server can return different answers depending on policy, network information, endpoint health, or distribution rules. This allows operators to influence where users connect without changing the application itself.
This idea is commonly called DNS steering.
Several steering techniques are widely used:
They solve different problems.
The important word is influence.
DNS can influence which destination a client learns about. It cannot guarantee which network path the client takes, how long the client keeps an address cached, whether an existing TCP connection is reused, or whether traffic will follow an exact percentage.
Understanding that boundary is essential before designing a DNS steering system.
Imagine that www.example.com is available from three infrastructure locations.
+----------------------+
| www.example.com |
+----------+-----------+
|
DNS decision
|
+-----------------+-----------------+
| | |
v v v
192.0.2.10 198.51.100.10 203.0.113.10
Site A Site B Site CAll three locations can serve the website.
The question is:
Which address should DNS return?
A simple DNS configuration could return all three addresses.
That may be enough for some environments.
But operators might have additional requirements.
For example:
These requirements lead to different steering techniques.
DNS steering changes the DNS answer based on policy.
A basic authoritative answer might look like this:
www.example.com. 300 IN A 192.0.2.10A steering system might instead evaluate information associated with the query before choosing the answer.
Conceptually:
DNS Query
|
v
+--------------------+
| Determine context |
+---------+----------+
|
v
+--------------------+
| Apply policy |
+---------+----------+
|
v
+--------------------+
| Select eligible IP |
+---------+----------+
|
v
DNS ResponseThe policy might consider:
Health
Prefix
ASN
Geography
Weight
Default policyThese inputs do not all perform the same job.
A useful mental model is:
| Technique | Main Job |
|---|---|
| Prefix-based | Match a known network |
| ASN-aware | Match a network operator or provider |
| Geographic | Match an approximate location |
| Weighted | Distribute queries among destinations |
| Failover | Remove unavailable destinations |
This distinction becomes important when several policies are combined.
One of the most important concepts in DNS steering is understanding where the query comes from.
A typical lookup looks like this:
User
|
v
Stub Resolver
|
v
Recursive DNS Resolver
|
v
Authoritative DNSThe authoritative DNS server normally receives the query from the recursive resolver.
It may therefore see:
Recursive resolver IPrather than:
Actual user IPRFC 1034 describes the resolver and authoritative name server model that forms the foundation of DNS operation.
This matters greatly for geographic, ASN, and prefix steering.
Suppose a user is in Manila but uses a recursive DNS service whose query infrastructure appears somewhere else.
If the authoritative DNS server bases its decision only on the recursive resolver’s IP address, it could classify the request differently from the user’s actual network.
EDNS Client Subnet, commonly called ECS, attempts to improve network-sensitive DNS responses.
RFC 7871 defines an EDNS option that allows a recursive resolver to provide part of the originating client’s network prefix to an authoritative DNS server.
Instead of the authoritative server seeing only:
Resolver: Xit may receive information similar to:
Resolver: X
Client network hint: 198.51.100.0/24The authoritative server can then make a more specific routing decision.
Conceptually:
Client
198.51.100.x
|
v
Recursive Resolver
|
| ECS: 198.51.100.0/24
v
Authoritative DNS
|
v
Prefix / ASN / Geo policyECS is built using EDNS mechanisms described by RFC 6891.
However, ECS is not something operators should assume will always exist.
RFC 7871 itself identifies privacy, caching, and operational concerns. It is an Informational RFC rather than an Internet Standards Track specification.
A DNS steering system therefore needs sensible behavior both with and without ECS.
Weighted routing is one of the simplest steering techniques.
You assign relative weights to destinations.
For example:
Site A: 70
Site B: 30The intended distribution is approximately:
Site A ############################### 70%
Site B ############# 30%Possible DNS answers:
www.example.com -> 192.0.2.10
www.example.com -> 192.0.2.10
www.example.com -> 198.51.100.10
www.example.com -> 192.0.2.10Over enough DNS decisions, the selection process can approach the configured ratio.
Weighted steering works well for:
For example, when introducing Site B:
Stage 1
Site A: 95
Site B: 5
Stage 2
Site A: 80
Site B: 20
Stage 3
Site A: 50
Site B: 50This allows operators to increase exposure gradually.
A DNS weight does not equal an exact percentage of application traffic.
Consider this configuration:
Site A: 50
Site B: 50It is tempting to assume that HTTP traffic will also be split exactly 50/50.
That assumption is wrong.
DNS caching changes the result.
Suppose Resolver A serves 100,000 users while Resolver B serves 1,000.
Resolver A receives:
192.0.2.10Resolver B receives:
198.51.100.10The DNS decision was:
50% Site A
50% Site BBut user traffic could become approximately:
Site A: 100,000 users
Site B: 1,000 usersDNS query distribution and application traffic distribution are different measurements.
Caching is a fundamental part of DNS. RFC 1034 defines TTL as the time limit controlling how long resource records can remain cached.
Other factors also affect weighted results:
Weighted DNS should therefore be treated as probabilistic steering, not precise traffic accounting.
Geographic routing chooses an answer based on the estimated geographic location associated with the DNS request.
Example policy:
Philippines -> Site A
Singapore -> Site B
United States -> Site C
Default -> Site AConceptually:
DNS Query
|
v
Geographic lookup
|
+------------+------------+
| | |
v v v
Region A Region B Region C
| | |
v v v
192.0.2.10 198.51.100.10 203.0.113.10Geo routing is commonly used when infrastructure exists in several regions.
Geographic routing can help with:
For example:
Users associated with Region A
|
v
192.0.2.10
Users associated with Region B
|
v
198.51.100.10This looks simple.
The difficult part is determining what “associated with Region A” actually means.
An authoritative DNS server usually sees the recursive resolver.
Without ECS, geographic routing may effectively mean:
Location of resolverrather than:
Location of userThese can differ.
Several situations make geographic classification less reliable:
ECS can provide a network prefix that may improve the classification, but ECS availability cannot be assumed. RFC 7871 also documents privacy and cache implications associated with sending client subnet information.
Another common mistake is assuming:
Nearest geographically = fastestThat is not always true.
Consider:
User
|
+------ 800 km ------ Site A
|
+----- 1,500 km ----- Site BSite B might still perform better if:
DNS geographic steering understands geography.
It does not automatically understand Internet routing quality.
That limitation leads us to ASN-aware steering.
An Autonomous System Number, or ASN, identifies an autonomous system participating in Internet routing.
ISPs, cloud networks, large enterprises, carriers, and other network operators commonly operate autonomous systems.
ASN-aware DNS steering asks a different question.
Instead of:
Where is this request located?
it asks:
Which network does this request belong to?
Conceptually:
DNS request
|
v
Determine network prefix
|
v
Map prefix to ASN
|
v
Apply ASN policyExample:
ISP A -> Site A
ISP B -> Site B
ISP C -> Site C
Others -> default policyImagine two infrastructure locations.
Site A
|
Provider X
|
|
Internet
|
|
Provider Y
|
Site BUsers from ISP A might have excellent connectivity to Site A.
Users from ISP B might have much better connectivity to Site B.
Both groups may be located in the same city.
A geographic rule would treat them as equivalent.
An ASN rule can distinguish them.
Example:
Same geographic area
ISP A users ----------> Site A
ISP B users ----------> Site BThis can be useful when operators have real network knowledge such as:
The same resolver visibility problem appears again.
Without ECS, the authoritative server may identify:
ASN of recursive resolverinstead of:
ASN of actual clientThat distinction matters.
Consider:
User on ISP A
|
v
Public DNS Resolver
|
v
Authoritative DNSThe authoritative server might classify the query using the public DNS provider’s network.
The steering decision would then be based on the wrong ASN for the user.
ECS can help because it can provide part of the client’s network prefix.
But again, ECS should be treated as an optional signal rather than a universal feature.
ASN databases also change as routing announcements change.
Operators must keep network-to-AS mappings current.
Prefix steering is more specific than ASN routing.
Instead of matching an entire network operator, the DNS policy matches a particular IP prefix.
Example:
198.51.100.0/24 -> Site A
203.0.113.0/24 -> Site B
Default -> Site CConceptually:
Query context
|
v
198.51.100.0/24 ?
|
yes
|
v
192.0.2.10This allows very precise policy rules.
An ISP may operate many prefixes.
Those prefixes may represent:
An ASN rule might be too broad.
For example:
ASN ExampleNet
|
+-- Prefix A -> Site A works best
|
+-- Prefix B -> Site B works best
|
+-- Prefix C -> Site B works bestAn ASN-wide rule would lose that distinction.
Prefix policies allow finer control.
When prefix rules overlap, the more specific prefix generally needs to take priority.
Consider:
198.51.100.0/24 -> Site A
198.51.100.0/25 -> Site BA client associated with:
198.51.100.42matches both prefixes.
The /25 is more specific.
Conceptually:
198.51.100.0/24
|-----------------------------------------------|
198.51.100.0/25
|-----------------------|
Client
198.51.100.42
^The more specific policy should normally be selected.
Longest-prefix matching is also part of ECS-aware cache handling described by RFC 7871.
Prefix routing gives operators more control, but it also creates more operational work.
Networks change.
Prefixes may be:
Large prefix policy tables can also become difficult to understand.
For example:
198.51.100.0/20
198.51.100.0/21
198.51.104.0/22
198.51.104.0/23
198.51.105.0/24Without clear policy rules and change management, overlapping prefixes can produce unexpected answers.
Prefix steering should therefore be used where the additional precision provides a clear operational benefit.
Failover steering solves a different problem.
The question is no longer:
Which destination is preferred?
The question becomes:
Which destinations are currently eligible to receive new DNS-directed traffic?
Consider:
Primary
192.0.2.10
Secondary
198.51.100.10Normal operation:
www.example.com
|
v
192.0.2.10If health checks determine that Site A should no longer receive new traffic:
www.example.com
|
v
198.51.100.10Conceptually:
Health Check
|
v
Primary OK?
/ \
yes no
/ \
v v
192.0.2.10 198.51.100.10Failover is often better understood as a filter around other steering policies.
Imagine this configuration:
Site A weight: 60
Site B weight: 30
Site C weight: 10Under normal conditions:
Eligible destinations:
Site A
Site B
Site CNow Site B becomes unavailable.
The system should first remove Site B from consideration.
Eligible destinations:
Site A
Site CWeighted routing can then operate across the remaining destinations.
Conceptually:
All destinations
|
v
Health filtering
|
v
Eligible destinations
|
v
Prefix / ASN / Geo policy
|
v
Weighted selection
|
v
DNS answerThis illustrates why failover and weighted routing are not really competing techniques.
They operate at different stages of the decision.
This is one of the most important operational lessons in DNS steering.
Suppose:
www.example.com
TTL = 300 secondsA recursive resolver receives:
192.0.2.10Thirty seconds later, that destination fails.
Your authoritative system might immediately change its answer to:
198.51.100.10But the recursive resolver can still have the old answer cached.
Authoritative DNS
198.51.100.10
X
Recursive cache
192.0.2.10DNS cannot remotely erase that cache.
RFC 1034 defines TTL as the time limit on how long an RR can remain cached.
This means DNS failover should be thought of as:
Steering future DNS resolutions away from a failed destination.
It does not guarantee immediate movement of every active user.
Some recursive resolvers can return expired DNS information when authoritative resolution is temporarily unavailable.
RFC 8767 describes this behavior as serving stale data to improve DNS resiliency.
That is useful during DNS outages.
But it also means operators should avoid thinking of TTL expiration as an absolute guarantee that an old answer can never appear again.
DNS behavior during failures involves several systems:
Authoritative DNS
Recursive resolver
Resolver cache
Client cache
Application
Network
Destination serverA steering system controls only part of this chain.
Suppose an operator accidentally returns:
NXDOMAINduring an outage.
That negative answer may itself be cached.
RFC 2308 defines negative caching behavior for DNS.
This can create a worse incident.
Instead of clients receiving a less desirable destination, they may believe the hostname does not exist.
That is why operators should be very careful about using NXDOMAIN as part of failover logic.
An unavailable backend does not normally mean the DNS name stopped existing.
Here is a practical comparison.
| Technique | Decision Input | Main Purpose | Main Weakness |
|---|---|---|---|
| Weighted | Configured ratios | Distribute DNS selections | Does not guarantee traffic percentages |
| Geographic | Approximate location | Regional steering | Resolver location may differ from user |
| ASN-aware | Network operator | ISP or carrier steering | Resolver ASN may differ from user ASN |
| Prefix-based | Network prefix | Precise network policies | Policy maintenance becomes complex |
| Failover | Health state | Avoid unhealthy destinations | DNS caches delay complete traffic movement |
Another way to view them:
Precision
^
|
Prefix | **********
ASN | ********
Geo | ******
Weighted | ***
|
+-------------------->
Policy specificityFailover does not fit neatly on this scale because it answers a different question: whether a destination should remain eligible.
Consider three service locations.
Site A
192.0.2.10
Site B
198.51.100.10
Site C
203.0.113.10The operator wants the following behavior:
Conceptually:
DNS Query
|
v
Determine context
|
v
Remove unhealthy
destinations
|
v
Prefix match?
/ \
yes no
| |
v v
Prefix ASN match?
policy / \
yes no
| |
v v
ASN Geo match?
policy / \
yes no
| |
v v
Geo Weighted
policy defaultThis is only a conceptual model.
Real implementations may arrange policy stages differently.
The important design rule is consistency.
Operators should be able to answer:
If several rules match the same DNS request, which rule wins?
If that question has no clear answer, the steering design is already too difficult to operate safely.
Operators can inspect DNS answers using dig.
For example:
dig www.example.com ATo display only the returned address:
dig www.example.com A +shortDuring testing, query more than one recursive resolver and compare the result.
You can also query an authoritative server directly:
dig @ns1.example.com www.example.com AIf your test environment supports ECS, BIND’s dig can construct queries containing an ECS prefix.
Conceptually:
dig @ns1.example.com www.example.com A +subnet=198.51.100.0/24This is useful for controlled testing of network-specific policies.
Do not assume that ordinary public DNS queries will always carry ECS information.
DNS steering is powerful because it operates before a client connects to the destination.
But its control stops there.
DNS can influence:
DNS cannot fully control:
HTTP operates at the application level and has its own request and connection behavior, as defined in RFC 9110.
TCP also maintains transport-layer connection state independently of DNS resolution, as described by RFC 9293.
Changing a DNS response therefore does not magically move an existing TCP connection.
DNS steering introduces policy into a system that many operators expect to be simple.
That creates several risks.
Consider:
Prefix overrides ASN
ASN overrides country
Country overrides region
Region applies weights
Weights depend on health
Health has multiple statesThis may be technically possible.
It may also become extremely difficult to troubleshoot.
Start with the smallest rule set that solves the actual requirement.
This mistake affects:
Always distinguish:
DNS query sourcefrom:
Actual application clientThey may represent different networks.
A weight of:
80 / 20does not guarantee:
80% / 20% HTTP trafficDNS caching makes that impossible to promise accurately from DNS alone.
Operators sometimes set TTLs extremely low because they want faster steering changes.
That has costs.
Lower TTLs generally cause more frequent DNS resolution and greater dependence on the availability of authoritative infrastructure.
TTL should match the operational requirement rather than simply being made as small as possible.
RFC 1034 explicitly describes TTL as the mechanism controlling how long cached resource records may be retained.
Geography is only one input.
Real Internet performance depends on:
Geographic distance cannot describe all of these.
Suppose one health probe fails.
Should the DNS system immediately remove the destination?
Maybe not.
A single failed probe could result from:
Health policy needs enough evidence to avoid unnecessary route changes.
At the same time, it must react quickly enough to real failures.
This balance belongs to health-check design, which should be treated separately from basic DNS policy.
Failover gets most of the attention.
Recovery matters just as much.
Consider:
Primary fails
|
v
Secondary activated
|
v
Primary recovers
|
?Should traffic immediately return?
Should it return gradually?
Should the recovered endpoint remain under observation first?
Could weighted routing return a small percentage before full restoration?
Operators should define recovery behavior before an incident occurs.
A few rules make DNS steering much easier to operate.
Every steering policy should eventually lead to an answer.
Example:
Prefix policy
|
no match
v
ASN policy
|
no match
v
Geo policy
|
no match
v
DefaultUnknown networks should not become accidental outages.
A useful conceptual hierarchy is:
Specific prefix
|
v
ASN
|
v
Geography
|
v
General policyThis is not a protocol requirement.
It is an operational pattern that makes policy easier to understand.
An unhealthy destination should usually be excluded before distribution rules choose among destinations.
Candidates
|
v
Health filter
|
v
Eligible candidates
|
v
Steering policyThis keeps availability logic separate from routing preference.
Your policy must work when ECS is absent.
Think of ECS as additional context.
Do not make basic DNS resolution depend completely on receiving it.
RFC 7871 describes ECS as a mechanism for carrying network information, but it also documents cache and privacy concerns.
Measure at least three things separately:
DNS queries
DNS answers
Application trafficThey are related.
They are not identical.
For example:
50% DNS selectionsdoes not necessarily produce:
50% HTTP requestsWhen troubleshooting a steering system, the final answer alone is often insufficient.
Operators should be able to determine why a policy returned a destination.
Conceptually:
Query:
www.example.com
Context:
Prefix matched: no
ASN matched: ISP-B
Geo: Region-A
Health:
Site A = healthy
Site B = healthy
Decision:
ASN policy
Answer:
198.51.100.10Without decision visibility, complex DNS policies become difficult to troubleshoot.
Do not test geo or ASN steering from one workstation and assume everything works.
Test from:
You need to observe the system from more than one point of view.
No.
DNS controls answers.
Application load depends on many additional systems.
Usually not.
It normally sees the recursive resolver unless additional client subnet information is available.
No.
Geography and network performance are different measurements.
Not necessarily.
If the authoritative server sees a public resolver’s network, both ASN and geographic classification may be based on the resolver rather than the user.
Prefix routing can become difficult to maintain when thousands of specific policies accumulate.
Use specificity only where it provides a clear benefit.
DNS updates can happen quickly at the authoritative server.
Cached answers can continue directing clients toward the previous destination.
Existing connections can also continue independently of DNS.
TTL controls DNS caching behavior, but real systems include recursive caches, application caches, and serve-stale behavior.
RFC 8767 specifically describes circumstances where resolvers may serve expired DNS information after refresh attempts fail.
Weighted, geographic, ASN-aware, prefix-based, and failover routing solve different problems.
Think of them this way:
WEIGHT
"How should selections be distributed?"
GEO
"Which approximate location does this request represent?"
ASN
"Which network operator does this request represent?"
PREFIX
"Does this request belong to a specific network?"
FAILOVER
"Which destinations are currently allowed to receive new traffic?"Weighted routing is good for gradual distribution, but it cannot guarantee exact traffic percentages.
Geographic routing is useful for regional policies, but geographic proximity does not guarantee good network performance.
ASN-aware routing can account for network-provider differences, but resolver visibility can reduce accuracy.
Prefix-based routing gives the most specific network policy, but large prefix tables create operational complexity.
Failover routing helps stop new DNS-directed traffic from going toward unhealthy infrastructure, but caching prevents DNS failover from being instantaneous.
The most important lesson is simple:
DNS steering influences where new connections may go. It does not directly control every connection, packet, route, cache, or application session.
Good DNS steering begins by respecting that boundary.
The remaining articles can build on this model by examining topics such as health evaluation, policy ordering, failure handling, observability, testing, operational safeguards, and production-readiness practices.
The important point is that DNS steering is not one routing algorithm.
It is a collection of policy tools.
Good engineering comes from understanding what each tool can do, what information it depends on, and where its control ends.