Tuesday, November 13, 2007

DNS clients send two types of queries Iterative and Recursive queries



Let's try to understand two types of queries are being used by DNS server for name resolutions.

Iterative queries
(query the best answer)

  • Client expects best answer from server
  • DNS server does not query other DNS servers
  • May refer client to another DNS server
  • Typically sent by DNS servers, not Microsoft Windows clients

Let us say our DNS name space is SMTP25.org. This mean our domain controller will be Authoritative for SMTP25.org and all domain controller, which are running DNS, will know any type of question they maybe asked by client for their own DNS name space.

We will perform Iterative query to the SMTP25.org DNS servers for Microsoft.com, and will look into each step and observer what happens.

  • Client makes iterative query to one of the DC's/DNS servers on SMTP25.org.
  • Since the DC/DNS serve does not own the DNS name space, it informs Client as follows
  • I am not authoritative for this DNS Name Space (SMTP25.org), but I do know who the Authoritative server is, for sales.microsoft.com (SMTP25.org DNS server did the query and got an IP address for DNS server, who owns the records for Microsoft.com) and hands out the IP address of the DNS server does Authoritative for Microsoft.com.
  • Client now does know the IP address of the Authoritative DNS server for Microsoft.com and ask this DNS server same question, I need to get to Sales.Microsoft.com, your IP is given to me as Authoritative DNS server, can provide me the resources I am trying to access.
  • The DNS server replies, I am not authoritative for Sales.Microsoft.com, but I do know who the Authoritative server is, here is the IP Address go ask him.
  • Finally Client has the IP address for the DNS server, who is authoritative for Sales.Microsoft.com

    Client ask the same question, server pulls out the IP address for the requested resources, and hands it to the client and finally happy end, Client can open direct TCP/IP connection to this resource server.

As you can see client is doing all the heavy lifting, client needs to go to different DNS server each time, client get partial answer and finally client is able to locate the resource server IP Addresses.

Recursive queries

We will use same story for recursive query. The DNS server will perform the heavy lifting; client is talking too at the first time. If we were the ask same question, to the DNS server we are talking too,

Where is Sales.microsoft.com the same process will be performed by a DNS server and when DNS server is able to locate the IP address for requested namespace, DNS server will return this information to the client, so that client can open direct TCP/IP connection to that server.

Just like, you have a personal secretary and you want to find the phone number of your best body "James" from high school. You ask your secretary to get you James number, your secretary calls your high school, gets information about James home address, She lookup up on the yellow book locates the phone number calls the number , figures out James in no longer living there, but people give her a number where he can be reached at. She makes sure James is available on that number, and turns the number to you. Now you call your body James and start talking to him. Your secretary has done all the heavy lifting for you, which she used Recursive queries to get the James number.

  • Now if you are not able to have a secretary, you have to call the Scholl first.
  • Scholl gives you a number to call.
  • You call that number second.
  • The people who live in that home give you another number to cal.
  • Finally, you call that number and able talk to your body. This would be iterative query.

Regards,

Oz ozugurlu

No comments: