Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Resolver Library Routines

IP.com Disclosure Number: IPCOM000115465D
Original Publication Date: 1995-May-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 4 page(s) / 116K

Publishing Venue

IBM

Related People

Amra, NK: AUTHOR [+3]

Abstract

Disclosed is an implementation of a set of library routines to handle Domain Name System (DNS) packets that come from name servers on the internet domain. These library routines are designed to make, send, interpret, parse and translate DNS packets on the computer system. Additions to the common resolver routines seen on other platforms include the close and translate functions. Along with these library routines is a caching mechanism designed to help keep the network traffic low.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Resolver Library Routines

      Disclosed is an implementation of a set of library routines to
handle Domain Name System (DNS) packets that come from name servers
on the internet domain.  These library routines are designed to make,
send, interpret, parse and translate DNS packets on the computer
system.  Additions to the common resolver routines seen on other
platforms include the close and translate functions.  Along with
these library routines is a caching mechanism designed to help keep
the network traffic low.

      Fig. 1 shows the flow of functions the resolver library
routines perform.  The application requests a service from these
routines.  The routines will first make a DNS packet.  Then the cache
is searched to determine if this request has recently been performed.
If so, the response from the name server is in the cache.  The entry
is retrieved from the cache and the entry is parsed and interpreted
for the correct response to the request.  If it is not found in the
cache, the packet is translated from EBCDIC to ASCII and sent to the
remote name server.  When the answer is received from the remote name
server, it is translated from ASCII to EBCDIC and inserted in the
cache (in most cases).  The packet is then parsed and interpreted.
The application then receives the answer to the request.

The list of common resolver library routines included here are as
follows:
  1.  res_init() - initialize the job for the resolver routines.
  2.  res_mkquery() - make the DNS packet to send to a name server.
  3.  res_query() - send a domain query.
  4.  res_search() - search for a domain name.
  5.  res_send() - send buffered domain query.  (DNS packet)
  6.  dn_expand() - expand a domain name from the compressed internet
       form.
  7.  dn_comp() - compress a domain name from the expanded form.
  8.  dn_find() - find a compressed domain name in a packet.
  9.  dn_skipname() - skip over the current compressed domain name.
 10. _putshort() - put a 2 byte integer into a packet.
 11. _putlong() - put a 4 byte integer into a packet.
 12. _getshort() - get a 2 byte integer from a packet.
 13. _getlong() - get a 4 byte integer from a packet.

      An application can use the resolver library routines to resolve
a name to an internet address.  This is done by calling the
res_search() resolver routine.  Fig. 2 shows an example of an
application using the gethostbyname() application program interface
(API) to interface with the resolver library routines for the purpose
of resolving the name.  The res_search() routine will create
different possible names from the name given it.  The newly created
name is passed to res_query().  The res_search() routine will do this
until all possibilities are exhausted or there is a success.  The
res_query() routine passes the name to res_mkquery().  The
res_mkquery() routine will create the DNS packet in...