<?xml version="1.0"?>
<?rfc compact="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc toc="yes" ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc ipr="trust200902" docName="draft-andrews-dns-no-response-issue-03.txt">
  <front>
    <title abbrev="Failure to respond">A Common Operational Problem in DNS Servers - Failure To Respond.</title>
    <author initials="M." surname="Andrews" fullname="M. Andrews">
      <organization abbrev="ISC">Internet Systems Consortium</organization>
      <address>
        <postal>
          <street>950 Charter Street</street>
          <city>Redwood City</city>
          <region>CA</region>
          <code>94063</code>
          <country>US</country>
        </postal>
        <email>marka@isc.org</email>
      </address>
    </author>
    <date month="May" year="2014"/>
    <abstract>
      <t>
	The DNS is a query / response protocol.  Failure to respond to
	queries causes both immediate operational problems and long term
	problems with protocol development.
      </t>
      <t>
	This document identifies a number of common classes of
	queries that some servers fail to respond too.  This document
	also suggests procedures for TLD and other similar zone
	operators to apply to reduce / eliminate the problem.
      </t>
    </abstract>
  </front>
  <middle>
    <section toc="yes" anchor="intro" title="Introduction">
      <t>
	The DNS <xref target="RFC1034"/>, <xref target="RFC1035"/>
	is a query / response protocol.  Failure to respond to
	queries causes both immediate operational problems and long
	term problems with protocol development.
      </t>
      <t>
	Failure to respond to a query is indistinguishable from a
	packet loss without doing a analysis of query response
	patterns and results in unnecessary additional queries being
	made by DNS clients and unnecessary delays being introduced
	to the resolution process.
      </t>
      <t>
	Due to the inability to distingish between packet loss and
	nameservers dropping EDNS <xref target="RFC6891"/> queries,
	packet loss is sometimes misclassified as lack of EDNS
	support which can lead to DNSSEC validation failures.
      </t>
      <t>
	Allowing servers which fail to respond to queries to remain
	results in developers being afraid to deploy implementations
	of recent standards.  Such servers need to be identified and
	corrected / replaced.
      </t>
      <t>
	The DNS has response codes that cover almost any conceivable
	query response.  A nameserver should be able to respond to
	any conceivable query using them.
      </t>
      <t>
	Unless a nameserver is under attack, it should respond to
	all queries directed to it as a result of following
	delegations.  Additionally code should not assume that there
	isn't a delegation to the server even if it is not configured
	to serve the zone.  Broken delegation are a common occurrence
	in the DNS and receiving queries for zones that you are not
	configured for is not a necessarily a indication that you
	are under attack.  Parent zone operators are supposed to
	regularly check that the delegating NS records are consistent
	with those of the delegated zone and to correct them when
	they are not <xref target="RFC1034"/>.  If this was being done
	regularly the instances of broke delegations would be much lower.
      </t>
      <t>
	When a nameserver is under attack it may wish to drop packets.
	A common attack is to use a nameserver as a amplifier by
	sending spoofed packets.  This is done because response
	packets are bigger than the queries and big amplification
	factors are available especially if EDNS is supported.
	Limiting the rate of responses is reasonable when this
	is occuring and the client should retry.  This however only
	works if legitimate clients are not being forced to guess
	whether EDNS queries are accept or not.  While there is
	still a pool of servers that don't repsond to EDNS requests,
	clients have no way to know if the lack of response is due
	to packet loss, EDNS packets not being supported or rate
	limiting due to the server being under attack.  Mis-classifications
	of server characteristics are unavoidable when rate limiting
	is done.
      </t>
    </section>
    <section toc="yes" anchor="query-classes" title="Common queries class that result in non responses.">
      <t>
	There are three common query classes that result in non
	responses today.  These are EDNS queries, queries for unknown
	(unallocated) or unsupported types and filtering of TCP
	queries.
      </t>
      <section toc="yes" anchor="edns-independent" title="EDNS Queries - Version Independent">
	<t>
	  Identifying servers that fail to respond to EDNS queries
	  can be done by first identifying that the server responds
	  to regular DNS queries then making a series of otherwise
	  identical responses using EDNS, then making the original
	  query again.  A series of EDNS queries is needed as at least
	  one DNS implementation responds to the first EDNS query
	  with FORMERR but fails to respond to subsequent queries
	  from the same address for a period until a regular DNS
	  query is made.  The EDNS query should specify a UDP buffer
	  size of 512 bytes to avoid false classification of not
	  supporting EDNS due to response packet size.
	</t>
	<t>
	  If the server responds to the first and last queries but
	  fails to respond to most or all of the EDNS queries it
	  is probably faulty.  The test should be repeated a number
	  of times to eliminate the likelihood of a false positive
	  due to packet loss.
	</t>
	<t>
	  Firewalls may also block larger EDNS responses but there
	  is no easy way to check authoritative servers to see if
	  the firewall is misconfigured.
	</t>
      </section>
      <section toc="yes" anchor="edns-specific" title="EDNS Queries - Version Specific">
	<t>
	  Some servers respond correctly to EDNS version 0 queries
	  but fail to respond to EDNS queries with version numbers
	  that are higher than zero.  Servers should respond
	  with BADVERS to EDNS queries with version numbers that
	  they do not support.
	</t>
      </section>
      <section toc="yes" anchor="unknown" title="Unknown / Unsupported Type Queries">
	<t>
	  Identifying servers that fail to respond to unknown or
	  unsupported types can be done by making an initial DNS
	  query for an A record, making a number of queries for
	  an unallocated type, them making a query for an A record
	  again.  IANA maintains a registry of allocated types.
	</t>
	<t>
	  If the server responds to the first and last queries but
	  fails to respond to the queries for the unallocated type
	  it is probably faulty.  The test should be repeated a
	  number of times to eliminate the likely hood of a false
	  positive due to packet loss.
	</t>
      </section>
      <section toc="yes" anchor="tcp" title="TCP Queries">
	<t>
	  All DNS servers are supposed to respond to queries over
	  TCP <xref target="RFC5966"/>.  Firewalls that drop TCP
	  connection attempts rather that resetting the connect
	  attempt or send a ICMP/ICMPv6 administratively prohibited
	  message introduce excessive delays to the resolution
	  process.
	</t>
	<t>
	  Whether a server accepts TCP connections can be tested
	  by first checking that it responds to UDP queries to
	  confirm that it is up and operating then attempting
	  the same query over TCP.  An additional query should
	  be made over UDP if the TCP connection attempt fails
	  to confirm that the server under test is still operating.
	</t>
      </section>
    </section>
    <section toc="yes" anchor="remediation" title="Remediating">
      <t>
	While the first step in remediating this problem is to get
	the offending nameserver code corrected, there is a very
	long tail problem with DNS servers in that it can often
	take over a decade between the code being corrected and a
	nameserver being upgraded with corrected code.  With that
	in mind it is requested that TLD, and other similar zone
	operators, take steps to identify and inform their customers,
	directly or indirectly through registrars, that they are
	running such servers and that the customers need to correct
	the problem.
      </t>
      <t>
	TLD operators should construct a list of servers child zones
	are delegated to along with a delegated zone name.  This
	name shall be the query name used to test the server as it
	is supposed to exist.
      </t>
      <t>
	For each server the TLD operator shall make an SOA query the
	delegated zone name.  This should result in the SOA record
	being returned in the answer section.  If the SOA record is
	not return but some other response is returned this is a
	indication of a bad delegation and the TLD operator should
	take whatever steps it normally takes to rectify a bad
	delegation.  If more that one zone is delegated to the server
	it should choose another zone until it finds a zone which
	responds correctly or it exhausts the list of zones delegated
	to the server.
      </t>
      <t>
	If the server fails to get a response to a SOA query the
	TLD operator should make a A query as some nameservers fail
	to respond to SOA queries but respond to A queries.  If it
	gets no response to the A query another delegated zone
	should be queried for as some nameservers fail to respond
	to zones they are not configured for.  If subsequent queries
	find a responding zone all delegation to this server need
	to be checked and rectified using the TLD's normal procedures.
      </t>
      <t>
	Having identified a working &lt;server, query name&gt; tuple the
	TLD operator should now check that the server responds to 
	EDNS, Unknown Query Type and TCP tests as described above.
	If the TLD operator finds that server fails any of the
	tests, the TLD operator shall take steps to inform the
	operator of the server that they are running a faulty
	nameserver and that they need to take steps to correct the
	matter.  The TLD operator shall also record the &lt;server,
	query name&gt; for followup testing.
      </t>
      <t>
	If repeated attempts to inform and get the customer
	to correct / replace the faulty server are unsuccessful
	the TLD operator shall remove all delegations to said
	server from the zone.
      </t>
      <t>
	It will also be necessary for TLD operators to repeat
	the scans periodically.  It is recommended that this
	be performed monthly backing off to bi-annually once
	the numbers of faulty servers found drops off to less
	than 1 in 100000 servers tested.  Follow up tests for
	faulty servers still need to be performed monthly.
      </t>
      <t>
	Some operators claim that they can't perform checks at
	registration time.  If a check is not performed at registration
	time it needs to be performed within a week of registration
	in order to detect faulty servers swiftly.
      </t>
      <t>
	Checking of delegations by TLD operators should be nothing
	new as they have been required from the very beginings of
	DNS to do this <xref target="RFC1034"/>.  Checking for
	compliance of nameserver operations should just be a extension
	of such testing.
      </t>
      <t>
	It is recommended that TLD operators setup a test web page
	which performs the tests the TLD operator performs as part
	of their regular audits to allow nameserver operators to
	test that they have correctly fixed their servers.  Such
	tests should be rate limited to avoid these pages being
	a denial of service vector.
      </t>
    </section>
    <section toc="yes" title="Firewalls and Load Balancers">
      <t>
	Firewalls and load balancers can affect the externally
	visible behaviour of a nameserver.  Tests for conformance
	need to be done from outside of any firewall so that the
	system as a whole is tested.
      </t>
      <t>
	Firewalls and load balancers should not drop DNS packets
	that they don't understand.  They should either pass through
	the packets or generate a appropriate error response.
      </t>
      <t>
	Requests for unknown query types are not attacks and
	should not be treated as such.
      </t>
    </section>
    <section toc="yes" anchor="response" title="Response Code Selection">
      <t>
	Choosing the correct response code when fixing a nameserver
	is important.  Just because a type is not implemented
	does not mean that NOTIMP is the correct response code to
	return.  Response codes need to be choosen considering how
	clients will handle them.
      </t>
      <t>
	For unimplemented opcodes NOTIMP is the expected response code.
      </t>
      <t>
	In general, for unimplemented type codes Name Error (NXDOMAIN)
	and NOERROR (no data) are the expected response codes.  A
	server is not supposed to serve a zone which contains
	unsupported types (<xref target="RFC1034"/>) so the only
	thing left is return if the QNAME exists or not.  NOTIMP
	and REFUSED are not useful responses as they force the
	clients to try all the authoritative servers for a zone
	looking for a server which will answer the query.
      </t>
      <t>
	Meta queries type may be the exception but these need to
	be thought about on a case by case basis.
      </t>
      <t>
      </t>
      <t>
	If you support EDNS and get a query with a unsupported EDNS version
	the correct response is BADVERS <xref target="RFC6891"/>.
      </t>
      <t>
	If you do not support EDNS at all FORMERR and NOTIMP are the expected
	error codes.  That said a mimimal EDNS server implementation just
	requires parsing the OPT records and responding with a empty OPT
	record.  There is no need to interpret any EDNS options present in
	the request as unsupported options are expected to be ignored
	<xref target="RFC6891"/>.
      </t>
    </section>
  </middle>
  <back>
    <references title="Normative References">
      <reference anchor="RFC1034">
        <front>
          <title>DOMAIN NAMES - CONCEPTS AND FACILITIES</title>
          <author initials="P." surname="Mockapetris" fullname="P. Mockapetris">
            <organization />
          </author>
          <date month="November" year="1987" />
        </front>
        <seriesInfo name="STD" value="13" />
        <seriesInfo name="RFC" value="1034" />
      </reference>
      <reference anchor="RFC1035">
        <front>
          <title>DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION</title>
          <author initials="P." surname="Mockapetris" fullname="P. Mockapetris">
            <organization />
          </author>
          <date month="November" year="1987" />
        </front>
        <seriesInfo name="STD" value="13" />
        <seriesInfo name="RFC" value="1035" />
      </reference>
      <reference anchor="RFC5966">
        <front>
          <title>DNS Transport over TCP - Implementation Requirements</title>
          <author initials="R." surname="Bellis" fullname="R. Bellis">
            <organization />
          </author>
          <date month="August" year="2010" />
        </front>
        <seriesInfo name="RFC" value="5966" />
      </reference>
      <reference anchor="RFC6891">
        <front>
          <title>Extension Mechanisms for DNS (EDNS(0))</title>
          <author initials="J." surname="Damas" fullname="J. Damas" />
          <author initials="M." surname="Graff" fullname="M. Graff" />
          <author initials="P." surname="Vixie" fullname="P. Vixie" />
          <date month="April" year="2013" />
        </front>
        <seriesInfo name="STD" value="75" />
        <seriesInfo name="RFC" value="6891" />
      </reference>
    </references>
  </back>
</rfc>
