DNS Configuration and Management Manual (G06.27+, H06.05+, J06.03+)
DNS Configuration on the NonStop Server
HP DNS Configuration and Management Manual—529432-003
3-2
Lightweight Resolver demon
running on the local host. Since the lightweight demon runs on every host and regularly
caches DNS data, the network communication is greatly reduced and results in
improved performance.
Lightweight Resolver demon
The lightweight demon (lwresd) runs only in the OSS environment. It listens for
resolver queries on a UDP port on the IPv4 loopback interface, 127.0.0.1, or the
IPv6 loopback interface ::1. lwresd can only be used by processes running on the
local machine. By default, port number 921 is used for lightweight resolver requests
and responses.
Incoming lightweight resolver requests are decoded by the name server, which then
resolves them using the DNS protocol. When the DNS lookup completes, lwresd
encodes the answers in the lightweight resolver format and returns them to the client
that made the request.
If the /etc/resolv.conf file contains any name server entries, lwresd sends recursive
DNS queries to those servers. This is similar to the use of forwarders in a caching
name server. If no name server entries are present or if forwarding fails, lwresd
resolves the queries autonomously starting at the root name servers, using a built-in
list of root server hints.
The simplest way of starting the lwresd process is to run it with the default options.
The IP addresses of the name servers to contact will be read from the /etc/resolv.conf
file. For example:
$> lwresd
Compiling Existing DNS Applications to Use the Lightweight
Resolver Library
You can recompile applications that use the native, socket-library-resolver APIs to use
the lightweight-resolver APIs without making changes to the source code. To change
your applications to use the lightweight resolver APIs, recompile the application with
the -DLWRES compiler option. This option instructs the preprocessor to make the
following replacements in the application program:
gethostbyname is replaced by lwres_gethostbyname
gethostbyname2 is replaced by lwres_gethostbyname2
gethostbyaddr is replaced by lwres_gethostbyaddr
getnameinfo is replaced by lwres_getnameinfo
getaddrinfo is replaced by lwres_getaddrinfo
freeaddrinfo is replaced by lwres_freeaddrinfo
gai_strerror is replaced by lwres_gai_strerror
hstrerror is replaced by lwres_hstrerror










