dns-query

Function

Package: socket

Arguments: &key type nameserver repeat timeout queue decode

The arguments are:

NameDefaultWhat
nameDepending on the value of the type argument this is either a string or an integer IP address
type:aThe type of dns query to make. :a means determine the ip address(es) for the given name. :ptr means determine the hostname for a give IP address. :mx means determine if there is another machine that email for name should be directed.
nameservernilIf specified this can be an IP address or a list of IP addresses. This overrides the configured list of nameservers for just this query.
repeat5How many times to try to get an answer to this query before giving up.
timeout5How 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.
queuetIf 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
decodetThe 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 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.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.