Table of Contents

OIL2 Class Standard.DNSresolver


class Standard . DNSresolver {
        int32   createdHTobj;
        int32   createdNSobj;
        int32   debugFlag;
        array   failure;
        oid     htObj;
        array   io_queue;
        int32   maxRetries;
        array   nameServers;
        int32   nextRequestId;
        int32   nsIndex;
        oid     nsObj;
        string  nsPort;
        assoc   optionFlags;
        int32   rotationActive;
        oid     serviceOID;
        oid     sockIPv6Obj;
        oid     sockObj;
        int32   timeoutPeriod;
        int32   useIP6first;
        int32   useTCPbyDefault;
inherits from Object;

DESCRIPTION

Class DNSresolver makes and parses a variety of Domain Name Service queries. This class provides the preferred interface for looking up host names and addresses.

Related Information

Class NameServerDirectory, HostTable.

METHODS


Standard.DNSresolver:create

DNSresolver:create()

Method Description

Creates and registers the name server interface. If a NameServerDirectory object does not exist, it is automatically created. If the HostTable object does not exist, it is created.


Standard.DNSresolver:getHostByName

DNSresolver:getHostByName(string host)

Method Description

Looks up a host name and returns the "official" host name and address of the host. This method takes one argument that is the name of the host for which information should be looked up.

Return Value

This method returns a two-element array. The first element is the canonical (official) name of the host and the second is the IP address of the host as a dotted-decimal string. If an error occurs, the first element is nil, the second element is an integer error code and the third is a corresponding NLM error message.


Standard.DNSresolver:getHostByAddress

DNSresolver:getHostByAddress(any addr)

Method Description

Looks up an IP address and returns the "official" host name. This method takes one argument that is the address to be looked up. It can be either an integer or dotted-decimal string.

Return Value

This method returns a two-element array. The first element is the query sent to the name server and the second is the official name of the host. If an error occurs, the first element is nil, the second element is an integer error code and the third is a corresponding NLM error message.