Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between recursive and iterative dns lookup

Tags:

sockets

dns

I am making a resolver and a nameserver program with out using dns libraries(such as netdb.h) by directly sending a dns message. but i have few problems. As far as i find out when we send a recursive request, the nameserver queried finds out the Records for us. Does the queries used by nameserver to query other servers, are similar to iterative queries? at least these images suggest this.

I am also confused if a client can do a iterative query or only a nameserver can do iterative queries?

Recursive dns lookup:

Recursive dns lookup

Iterative dns lookup: Iterative dns lookup

like image 480
mohit jain Avatar asked Apr 01 '12 16:04

mohit jain


1 Answers

Any DNS client (or "resolver") may perform iterative queries.

By definition, though, a resolver that does perform iterative queries is a recursive resolver, and not a stub resolver.

Stub resolvers are usually implemented as libraries, linked directly into your executable.

However it is also possible to build a complete recursive resolver as a standalone library. libunbound is a particularly good example.

like image 146
Alnitak Avatar answered Oct 02 '22 19:10

Alnitak