Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

DNS resolver (overview)

&pagelevel(4)&pagelevel

The DNS resolver handles the requests for resolving DNS domain names into IP addresses which application programs direct to the DNS Name Server.


Access to the DNS resolver

Application programs gain access to the resolver via the socket functions linked to the application, such as the functions gethostbyname() and gethostbyaddr() which are used for IPv4, and the functions getaddrinfo(), getnameinfo(), getipnodebyaddr() and getipnodebyname() which are used for IPv4 and IPv6:

gethostbyname()

gethostbyaddr()

getaddrinfo()

Supplies the associated IPv4 address for a host name.

Supplies the associated host name for an IPv4 address.

Supplies information on host names, host addresses and service
independently of the protocol.

getnameinfo()

Supplies the name of the communications partner independently of
the protocol.

getipnodebyaddr()

getipnodebyname()

Supplies information on host names independently of the protocol.

Supplies information on host addresses independently of the protocol.

Normally the resolver functions are provided in a library which is supplied with the products “SOCKETS(BS2000)” and “SOCKETS/XTI for POSIX”. The resolver functions used there are described in the manuals "SOCKETS(BS2000)” and “SOCKETS/XTI for POSIX”.

In POSIX it is also possible to include the complete resolver functionality in the application via the library. In this case the resolver functions are described in the online documentation on DNS. To access the online documentation you must install the DNS development modules (see "Installing and uninstalling the DNS resolver").


Resolution of the requests directed to the DNS resolver

The requests directed to the DNS resolver can be resolved in various ways:

  • Via the resolver provided with SOCKETS(BS2000) using the configuration file in the BS2000 file system. This configuration file has the name
    $TSOS.SYSDAT.SOCKETS.nnn.SOC6.RESOLV (up to and including openNet Server V3.0) or SYSDAT.LWRESD.nnn.RESOLV.CONF. (nnn specifies the version.)

    If you wish to use the DNS resolver functionality via SOCKETS(BS2000), the subsystem must be installed and running. Further information on this can be found in the “SOCKETS(BS2000)” manual.

  • With the resolver daemon provided via interNet Services DNS using the configuration file /etc/resolv.conf in the POSIX file system.

    If you wish to use the DNS resolver functionality via interNet Services DNS, the DNS resolver daemon must be installed and running. Further information on this can be found in the section “Installing and uninstalling the DNS resolver”.

  • By linking the resolver library using the configuration file /etc/resolv.conf in the POSIX file system (only possible in POSIX).

    Here you do not need to start either the SOCKETS(BS2000) subsystem or the DNS resolver daemon. The configuration file /etc/resolv.conf in the POSIX file system must, however, be configured correctly.

  • By querying the BCAM tables.


Order of the queries when resolving the resolver requests

How or in what order the queries occur is determined by the program platform (BS2000 or POSIX) and how the application is linked:

  • Sockets application in BS2000:

    The resolver functions initially use the internal Sockets resolver or, in Sockets 2.2 and higher, the LWRESD which runs in Native BS2000. Only if these supply no result is name/address conversion attempted with the entries from the BCAM tables. The DNS resolver daemon of interNet Services is never addressed.

  • Sockets application in POSIX (default):

    • When you are using the pure IPv4 functions gethostbyname() and gethostbyaddr() in a Sockets application in POSIX, first name or address conversion is attempted using the entries in the BCAM tables.

If a name or address cannot be determined by a BCAM request, the DNS resolver daemon of interNet Services DNS is called.

If the daemon supplies no result, the resolver functionality of BS2000 Sockets is called, i.e. LWRESD is called in Sockets 2.2 or higher.

Only if this conversion attempt fails do the gethostbyname() and gethostbyaddr() functions return an error.

    • When you are using the DNS resolver functions

      getaddrinfo(), getnameinfo(), getipnodebyaddr(), getipnodebyname(), first the resolver functionality of BS2000 Sockets is used.

      If a name or address cannot be determined hereby, name or address conversion is attempted using the entries in the BCAM tables.

      Only if this conversion attempt also fails do the getaddrinfo(), getnameinfo(), getipnodebyaddr(), getipnodebyname() functions return an error.

  • Sockets application in POSIX with linked resolver library of interNet Services DNS:

    By including the resolver library of interNet Services DNS results in the file
    /etc/resolv.conf being accessed exclusively in the POSIX file system for all calls (IPv4 and IPv6) when the application runs.

    A prerequisite for production of the application is that the DNS development modules are installed (see "Installing and uninstalling the DNS resolver").

    When the application is linked, the following link sequence must be observed:

    1. Resolver library of interNet Services DNS: /usr/lib/libbind.a

    2. SOCKETS/XTI library: /usr/lib/libsocket.a