[[Domain Name System]] DNS is a distributed database that maps domain names to IP addresses so that we don't have to remember lots of numbers to navigate the internet. Domain lookups (also termed ''name resolution'') is done using a DNS client library, the resolver, that is normally part of the system C library via the gethostbyname familly of calls. See resolver(5) and gethostbyname(3). The architecture is described by RFC 1034 [http://www.faqs.org/rfcs/rfc1034.html] and the DNS protocol by RFC 1035 [http://www.faqs.org/rfcs/rfc1035.html] One of the problems Tcl applications can encounter is that DNS resolution can be slow and processing is usually blocked while waiting for the DNS query to complete. This is because when you attempt to resolve a domain name, your local nameserver may need to ask another, who may need to ask another. DNS typically uses UDP so will retry queries a number of times using increasingly large delays between each retry. The net effect is that it can take up to 2 minutes to fail to resolve a domain name. In the meantime your application may be unresponsive the entire time as the thread of control is locked up in the resolver library and not running Tcl. To deal with this issue it is possible to perform lookups using Tcl only and deal with the replies using Tcl's [fileevent] system. This should allow the application to remain responsive. ---- [Jochen Loewer] has written a pure-Tcl (client TCP) implementation. [Pat Thoyts] has written a pure-Tcl (client TCP) implementation. * (and I wish I'd known about Jochen's one earlier). Anyway - I've submitted mine to [tcllib] and it can be examined at http://sourceforge.net/tracker/?func=detail&aid=520279&group_id=12883&atid=312883 [Scotty] knows DNS. See also [The DNS blocking problem]. [[Much more to explain, as of February 2002.]] ---- And in March 2002 or so, [tcllib] acquired its own dns package.