Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
DNSStdResolvers


NAME

DNSStdResolvers - standard implementation of DNSResolvers

SYNOPSIS

CONST noRecordsFound = 0;
CONST nonExistingDomain = 1;
CONST toomanyCNAMEs = 2;
CONST badCNAME = 3;
CONST errors = 4;
TYPE ErrorCode = SHORTINT; (* noRecordsFound... *)
TYPE ErrorEvent = POINTER TO ErrorEventRec;
TYPE ErrorEventRec =
      RECORD
	 (Events.EventRec)
	 errorcode: ErrorCode;
	 domain: DNSRecords.Name;
	 rrtype: DNSRecords.RRType;
      END;
VAR errormsg: ARRAY errors OF Events.Message;
VAR error: Events.EventType;
PROCEDURE Create(VAR resolver: DNSResolvers.Resolver);
PROCEDURE CreateFromConfiguration(VAR resolver: DNSResolvers.Resolver;
				  configuration: ARRAY OF CHAR);

DESCRIPTION

DNSStdResolvers provides an implementation of DNSResolvers that is based on DNSRequests and uses configurations that conform to resolv.conf(4). During its initialization, DNSResolvers.std is created, provided it was not already initialized by another implementation.

Create creates a standard resolver with a configuration from /etc/resolv.conf which can be overridden by some environment parameters (see below). If this file is not present or cannot be parsed and no DNS cache has been specified by the DNSCACHEIP environment variable, 127.0.0.1 is taken as nameserver.

CreateFromConfiguration works like Create but selects configuration as pathname of the configuration file instead of /etc/resolv.conf.

DIAGNOSTICS

DNSStdResolvers makes the error events of the underlying module DNSRequests available. In addition, following error events are created:
noRecordsFound
The domain name is valid but no records of the requested type were found.
nonExistingDomain
The given domain name does not exist.
toomanyCNAMEs
The chain of CNAME records was too long. This is possibly the cause of a reference cycle.
badCNAME
A CNAME record pointed to a non-existant domain name.

ENVIRONMENT

DNSCACHEIP
If defined, overrides the resolv.conf(4) configuration and selects the given IPv4 address (in dotted decimal notation) of a DNS cache as the only nameserver. This environment parameter was first defined by Dan J. Bernstein for his resolver library, see http://cr.yp.to/djbdns/resolve.html.
LOCALDOMAIN
Defines, if given, the local domain. By default, the settings of ``domain'' and ``search'' within the resolv.conf(4) configuration file are considered.
LOCALRES
Selects, if defined, the configuration file that conforms to resolv.conf(4). This environment parameter was introduced with the dig(1) utility of the BIND package.

FILES

/etc/resolv.conf
The default configuration file.

SEE ALSO

DNSResolvers
general interface for resolvers.
ResolvConfParser
is used to parse resolv.conf(4) configuration files.

BUGS

The sortlist directive within the resolv.conf(4) configuration is not supported.
Edited by: borchert, last change: 2004/06/09, revision: 1.2, converted to HTML: 2004/06/10

Oberon || Library || Module Index || Search Engine || Definition || Module