FunctionPackage: socketToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.2
Unrevised from 6.1

dns-query

Arguments: name &key type nameserver repeat timeout queue decode

The arguments are:

Name Default What
name Depending on the value of the type argument, this is either a string or an integer IP address.
type :a The type of dns query to make.
:a means determine the ip address(es) for the given name. (name should be a string.)
:ptr means determine the hostname for a given IP address. (name should be an integer IP address.)
:mx means determine if there is another machine that email for name should be directed. (name should be a string.)
nameserver nil If specified this can be an IP address or a list of IP addresses. This overrides the configured list of nameservers for just this query.
repeat 5 How many times to try to get an answer to this query before giving up.
timeout 5 How long to wait until we assume that a try has failed and we then try again or give up. The value should be an integer indicating a number of seconds.
queue t If true then handle this request using the background process that is backed up by a cache of recent answers. If this is nil then a request will always be sent to the nameserver
decode t The nameserver returns a structure of many fields. If true then dns-query will examine the returned structures and will return only the information requested by the query. If this is nil then the result of dns-query will be the actual information returned by the nameserver. This response is a dns-response object. See that page for information on this raw object.

If either nameserver is non nil or decode is nil, then queue will be set to nil regardless of the value of queue supplied. This ensures that a fresh query is sent to the nameserver.

Where an IP address is a valid argument, it can be specified as either an integer or as a string such as "192.132.95.1" or "127.1"

There are three return values from dns-query.

  1. the primary answer
  2. the amount of time that that answer is valid (in seconds) This can be a negative number (see the discussion in the The DNS API section of dns.htm for why).
  3. a list of other answers

There are examples of using dns-query in the subsections of The DNS API in dns.htm.

See dns.htm for information on the domain naming system utility in Allegro CL and see socket.htm for general information on sockets in Allegro CL.


Copyright (c) 1998-2002, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 6.2. This page was not revised from the 6.1 page.
Created 2002.2.26.

ToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.2
Unrevised from 6.1