<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-kerr-auth-dns-server-ans-gen-00" submissionType="independent" category="info" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude">

<front>
<title abbrev="DNS Answer Generation">Authoritative DNS Server-Side Answer Generation</title><seriesInfo value="draft-kerr-auth-dns-server-ans-gen-00" stream="independent" status="informational" name="Internet-Draft"></seriesInfo>
<author initials="S." surname="Kerr" fullname="Shane Kerr"><organization>IBM</organization><address><postal><street>Johan Huizingalaan 765</street>
<city>Amsterdam</city>
<code>1066 VH</code>
<country>Netherlands</country>
</postal><email>shane.kerr@ibm.com</email>
</address></author>
<date/>
<area>Internet</area>
<workgroup></workgroup>
<keyword>dns</keyword>

<abstract>
<t>The traditional model for DNS is that authoritative servers would read
DNS data from static zone files and use that to answer DNS queries.
Modern DNS servers do not act in this way, and their answers are
created dynamically - either periodically or at query time.</t>
<t>This document presents a taxonomy breaking down the most common and
useful methods used to customize responses on the authortiative side,
as well as a survey of implementations by current large authoritative
operators.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Many DNS authoritative servers have features to provide a different
answer for the same DNS query.</t>
<t>For example, one user querying the AAAA record for <tt>www.example.org</tt>
might get <tt>2001:db8:1111::42</tt> and another user querying the same
record might get <tt>2001:db8:9999::11</tt>. The DNS recursive resolver for
each will cache the record normally, and the user's software will
connect to different servers at different locations. The goal is to
give the user a &quot;better&quot; answer, by whatever metric the operator is
using; this can be latency, cost, adherence to regulations, or
anything else.</t>
<t>DNS was not designed with this kind of responses in mind, and there
are no standard ways to represent this data. This makes inter-operable
systems difficult or impossible to build.</t>
</section>

<section anchor="taxonomy"><name>Taxonomy</name>
<t>While there are a wide variety of ways that DNS authoritative servers
modify or generate answers, most of those fall into a few categories.
This section presents a taxonomy of such answers.</t>
<t>For each type of generated or modified answer we briefly describe:</t>

<ul>
<li>Configuration, which is roughly static</li>
<li>Data, which is relatively dynamic</li>
</ul>

<section anchor="cname-at-apex-alias"><name>CNAME-at-Apex (ALIAS)</name>
<t>In the DNS protocol the CNAME record type is special, and used to
indicate that a name can be resolved at some other name. This is not
possible at the apex of a zone (the &quot;top&quot; of a zone), because a CNAME
cannot appear at the same name as another type, and both the SOA and
NS types must appear at the zone apex.</t>
<t>A common solution is to do the equivalent of CNAME referral processing
but on the authoritative side. This is often called an ALIAS record,
but other names exist. Basically the authoritative server will do a
lookup at the ALIAS target, acting as a client, and return the record
there. This always includes address types (A and AAAA), although the
details of exactly how this works will vary.</t>
<t>Configuration: The record is usually configured with the DNS name of
the target, although other configuration might exist, for example
specified behavior on failure or TTL behavior.</t>
<t>Data: The &quot;data&quot; for this type of response is the result of a DNS
query.</t>
</section>

<section anchor="geoip"><name>GeoIP</name>
<t>The idea with GeoIP is to provide different answers depending on the
IP address of the client, with the hope that the IP address provides
a good hint at the physical location of the end user or system. This
is not always true, but is good enough for many purposes.</t>
<t>Additionally,
<eref target="https://www.rfc-editor.org/rfc/rfc7871">ECS (EDNS Client Subnet)</eref> is
often used to provide more information about the IP address of the end
user or system, which is useful for resolvers that are using IP
addresses in different physical locations from the users.</t>
<t>Typical reasons to provide different answers include:</t>

<ul>
<li><t>Better performance for users by sending them to servers closer to
where they are located.</t>
</li>
<li><t>Attempting to meet legal requirements, such as blocking access to
certain regions (for example due to gambling restrictions) or
ensuring that traffic stays within specific borders (for example to
avoid tariffs).</t>
</li>
</ul>
<t>Sometimes instead of using the IP address directly, these may be
mapped to an ASN (BGP Autonomous System Number). In a similar way that
IP is used as a proxy for geographical location, ASN can be used as a
proxy for the originating ISP (Internet Service Provider).</t>
<t>Configuration: Configuration will vary, but usually involves
specifying a country or region associated with answers. It may also
involve distance, for example choosing the answer closest to data
centers of a service.</t>
<t>Data: The mapping of IP to geographic location (or other type of
location) needs to be updated as IP addresses are transferred between
organizations or used by an organization in different sites.</t>
</section>

<section anchor="service-availability"><name>Service Availability</name>
<t>Within a single site some sort of load balancer can perform health
checks on back-end servers and route traffic depending on their
availability. For doing this across the Internet this is often done
using the DNS; this technique is sometimes called Global Server Load
Balancing (GLSB), DNS Server Load Balancing (DSLB) or just DNS Load
Balancing (DLB).</t>
<t>The details of what the authoritative server will return vary. For
example, the simplest case would be a service that returns one IP
address when a health check is successful, and a different IP address
otherwise. A more complicated case could be with pools of IP
addresses, and the answer generated based on regional load metrics.</t>
<t>Configuration: In many cases the configuration can be quite simple,
such as when a standby server is defined. If load or other factors are
used to define availability, then the configuration can be arbitrarily
complicated.</t>
<t>Data: The data about availability needs to be updated frequently, and
may be something that organizations keep private. Cloud providers
often have a rich set of availability information provided
automatically by hosted services they operate.</t>
</section>

<section anchor="traffic-steering"><name>Traffic Steering</name>
<t>The goal of traffic steering is to provide low latency, optimize for
cost, or other network-related characteristics of a service.</t>
<t>Traffic steering is similar to service availability, but is used to
alter responses based on the conditions of the network rather than
conditions of the services themselves. Real-User Measurements (RUM)
fall under this category; RUM is the ideal state, but the costs of
obtaining, maintaining, and distributing RUM may be more than the
benefits provided.</t>
<t>In contrast with availability checks, traffic steering is not about
the status of systems under the control of the service operator, but
about the Internet or possibly large systems not under their direct
control, like Content-Delivery Networks (CDN) or transit network
providers. While traffic steering requires more measurement points,
and the networks being measured are not under direct control of
the system operators, the modifications of DNS responses are similar.</t>
<t>Configuration: The source of information about the network is
configured, as well as they type of transformation that is done on
answers. The pool of answers might be configured, or it may be
generated data as well.</t>
<t>Data: The measurements of network characteristics is typically
proprietary information. For some services simple checks from a few
points will be enough, although even in those cases organizations will
often pay for distributed measurement networks. In other cases
measurements will be provided by vendors, often the DNS provider
themselves.</t>
</section>

<section anchor="everything-else"><name>Everything Else</name>
<t>Any server-side processing imaginable is done somewhere. This includes
anything from delivering weather reports to TXT-based traceroute
information. For example:</t>

<ul>
<li>Allow different types of server-side generation or modification to
be used together.</li>
<li>Weight responses, to split load unevenly.</li>
<li>Map contents of one zone or record to another at runtime.</li>
<li>Generate IP6.ARPA and IN-ADDR.ARPA responses based on AAAA or A
records.</li>
</ul>
<t>Configuration: Anything from no configuration at all to Lua scripts as
DNS records.</t>
<t>Data: Everything is data if you try hard enough.</t>
</section>
</section>

<section anchor="other-considerations"><name>Other Considerations</name>

<section anchor="ttl-trade-offs"><name>TTL Trade-Offs</name>
<t>The DNS includes a Time-To-Live (TTL) value which specifies the
maximum time that a system is allowed to use a value. Systems do not
have to use the value for that long - often a maximum of 1 day or even
shorter is used. There is no minimum TTL in DNS, although many systems
reject TTL that are too short.</t>
<t>A long TTL reduces load throughout all components in the DNS, and also
reduces the impact of outages or other problems looking up DNS
records. However, systems that modify or generate answers may need to
respond to rapidly-changing conditions. CDN often use TTL of 1 minute
or less.</t>
</section>
</section>

<section anchor="survey-of-some-dns-vendors"><name>Survey of Some DNS Vendors</name>
<t>In order to try to understand what the proprietary capabilities are in
this space, a survey of some current authoritative DNS vendors was
undertaken. This was not chosen based on science or data, although the
largest players in this space are represented.</t>

<section anchor="enterprise-managed-dns-vendors"><name>Enterprise Managed DNS Vendors</name>

<section anchor="ibm-ns1-connect"><name>IBM NS1 Connect</name>
<t>IBM NS1 Connect has a couple of custom record types, ALIAS and
REDIRECT.</t>
<t>They have a special zone type called a <em>linked zone</em>, which maps the
entire contents of one zone to another zone name. It does this without
DNS lookups, so is limited to IBM NS1 Connect customers.</t>
<t>They have a special record type called a <em>linked record</em>, which is
similar to a linked zone, but for a single record.</t>
<t>They have &quot;filter chains&quot; which provide special processing based on:</t>

<ul>
<li>Geographic (country, region, latitude/longitude)</li>
<li>Network (ASN or IP prefix)</li>
<li>Health check-based (load, up/down)</li>
<li>Traffic-steering (shuffle in various flavors, priority, pick N)</li>
<li>&quot;Pulsar&quot; (RUM-based)</li>
</ul>
<t>Any number of filter chains can be used on a record to answer queries.
Results are always on the same DNS type and name, and result codes
cannot be modified.</t>
</section>

<section anchor="ultradns"><name>UltraDNS</name>
<t>UltraDNS has a couple of custom record types, Apex Alias and Web
Forwarding.</t>
<t>UltraDNS has something called a Pool, which combines specific records
which work with specific checks. These are:</t>

<ul>
<li>Resource Distribution (RD): a group of A/AAAA records</li>
<li>SiteBacker (SB): A or CNAME that monitors backend service with a
redirect to another service on outage</li>
<li>Traffic Controller (TC): SB as a Global Server Load Balancing
solution</li>
<li>Simple Load Balancing (SLB): A/AAAA records, an HTTP monitor, and a
backup</li>
<li>Simple Failover (SF): simple monitoring with failover</li>
<li>Directional (DIR): using GeoIP to determine response</li>
</ul>
</section>
</section>

<section anchor="consumer-managed-dns-vendors"><name>Consumer Managed DNS Vendors</name>

<section anchor="dns-made-easy"><name>DNS Made Easy</name>
<t>DNS Made Easy has a couple of custom record types, ANAME and HTTP
redirect types.</t>
<t>They have a monitoring/failover solution.</t>
<t>Their upscale product, Constellix, also supports weighted round-robin
load balancing and GeoDNS (including custom IP rules).</t>
</section>

<section anchor="dnsimple"><name>dnsimple</name>
<t>dnsimple has a few proprietary types, ALIAS, POOL, and URL.</t>
<t>The POOL type picks a single CNAME from a set of CNAME.</t>
</section>
</section>

<section anchor="cloud-vendors"><name>Cloud Vendors</name>

<section anchor="aws-route-53"><name>AWS Route 53</name>
<t>Route 53 has an alias record types.</t>
<t>You can specify an address record just by the service, rather than an
IP address.</t>
<t>Route 53 has &quot;routing&quot; in the DNS, based on:</t>

<ul>
<li>Simple; NS are only supported via this policy</li>
<li>Geoproximity; either AWS region/local zone group (with bias
setting), or latitude/longitude</li>
<li>Latency; includes optional health check</li>
<li>IP address (of the end user); CIDR /24 (IPv4) or /32 (IPv6); &quot;CIDR
collections&quot;</li>
<li>Geolocation; IP to location mapping; if no default -&gt; &quot;no answer&quot; on
miss (NXDOMAIN? NODATA?); EDNS0 supported</li>
<li>Failover; based on AWS health checkers</li>
<li>Multivalue; health check for backend services</li>
<li>Weighted routing; distribute load proportionally</li>
</ul>
</section>

<section anchor="azure-dns"><name>Azure DNS</name>
<t>Azure has an alias record, which updates automatically for Azure data.
The alias record can point to several types of automatically
configured data, including applications and Traffic Manager, but also
CDN endpoints. It does not seem to be able to alias to non-Azure DNS
names.</t>
<t>Traffic Manager does support tracking hosts outside of Azure, either
by IP address or FQDN. It include &quot;endpoint monitoring&quot;, which is
looking at HTTP/HTTPS/TCP endpoints. It also includes RUM.</t>
</section>

<section anchor="google-cloud-dns"><name>Google Cloud DNS</name>
<t>Google Cloud DNS has a couple of custom types, ALIAS and IPSECVPNKEY.</t>
<t>There does not seem to be a way to provide custom responses.</t>
</section>
</section>

<section anchor="cdn-hosting-vendors"><name>CDN/Hosting Vendors</name>

<section anchor="akamai-edge-dns"><name>Akamai Edge DNS</name>
<t>Akamai has <em>alias zones</em>, which are a bit like ALIAS records but for the
whole zone.</t>
<t>Akamai has <em>zone apex mapping</em> via the AKAMAICDN record type, which is
a bit like ALIAS records.</t>
</section>

<section anchor="cloudflare"><name>Cloudflare</name>
<t>Cloudflare supports <em>CNAME flattening</em>, which is similar to ALIAS
records. The server will resolve the CNAME target and return it
directly.</t>
</section>
</section>

<section anchor="registrars"><name>Registrars</name>

<section anchor="godaddy-premium-dns-akamai"><name>GoDaddy Premium DNS (Akamai)</name>
<t>GoDaddy does not seem to have any special server-side record
processing.</t>
</section>
</section>
</section>

</middle>

<back>

<section anchor="acknowledgments"><name>Acknowledgments</name>
<t>Jan Vcelak reviewed the text, correcting errors and providing
additional information about advanced features of some vendors.</t>
</section>

</back>

</rfc>
