Querying The Database
Querying The Database
DNS queries can be sent from a DNS client (resolver) to a DNS server, or between two DNS servers.
A DNS query is merely a request for DNS resource records of a specified resource record type with a
specified DNS name. For example, a DNS query can request all resource records of type A (host) with a
specified DNS name.
There are two types of DNS queries that may be sent to a DNS server:
Recursive
Iterative
A recursivequery forces a DNS server to respond to a request with either a failure or a successful
response. DNS clients (resolvers) typically make recursive queries. With a recursive query, the DNS
server must contact any other DNS servers it needs to resolve the request. When it receives a successful
response from the other DNS server(s), it then sends a response to the DNS client. The recursive query
is the typical query type used by a resolver querying a DNS server and by a DNS server querying its
forwarder, which is another DNS server configured to handle requests forwarded to it. For more
information about forwarders, see “Forwarding” later in this document.
When a DNS server processes a recursive query and the query cannot be resolved from local data (local
zone files or cache of previous queries), the recursive query must be escalated to a root DNS server.
Each standards-based implementation of DNS includes a cache file (or root server hints) that contains
entries for the root DNS servers of the Internet domains. (If the DNS server is configured with a forwarder,
the forwarder is used before a root server is used.)
An iterative query is one in which the DNS server is expected to respond with the best local information it
has, based on what the DNS server knows from local zone files or from caching. This response is also
known as a referral if the DNS server is not authoritative for the name. If a DNS server does not have any
local information that can answer the query, it simply sends a negative response. A DNS server makes
this type of query as it tries to find names outside of its local domain(s) (when it is not configured with a
forwarder). It may have to query a number of outside DNS servers in an attempt to resolve the name.
Queries
Responses
Updates