question on query process

Kevin Oberman oberman at es.net
Tue May 25 16:28:14 UTC 2010


> Date: Tue, 25 May 2010 16:20:05 +0800 (CST)
> From: "Tech W." <techwww at yahoo.com.cn>
> Sender: bind-users-bounces+oberman=es.net at lists.isc.org
> 
> Hello,
> 
> I have a question about the query process of local dns cache to remote
> servers.  When my local dns cache want to find the A record for a
> domain name, for example, www.example.com If the A record doesn't
> exist in its cache, but example.com's NS records are there.  Thus the
> dns cache will query to example.com's ns servers directly, is it?
> 
> If the domain's NS records are not there, how will dns cache handle
> the case?

I assume you mean that you have a caching-only server, though this is not
entirely clear.

If you have an NS record cached for any part of www.example.com, you
will use that. If not, you will walk the DNS tree from the root. You
will first send the query to the root server you are using. (BIND picks
a preferred root server based on the responses it receives when starting
up.)

Root will return the nameservers for com. It will them pick one of the
returned answers and send the query to that server. It will then return
the NS records for example. Finally, you send th query to one of those
servers and should receive an authoritative response for www.example.com
which will be cached for future use for the time specified in the
record's TTL.

If the server already has a record for com, it will start there. If it
already has NS records for example.com, it will start there. Obviously,
there should not be many queries to the root. I'll leave why there are as
an exercise for network researchers and those who write really stupid,
often broken software, that uses DNS.
-- 
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman at es.net			Phone: +1 510 486-8634
Key fingerprint:059B 2DDF 031C 9BA3 14A4  EADA 927D EBB3 987B 3751



More information about the bind-users mailing list