[Previous] [Contents] [Index] [Next]

res_querydomain()

Query the local Internet domain name server

Synopsis:

#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>

int res_querydomain( const char * name,
                     const char * domain,
                     int class,
                     int type,
                     u_char * answer,
                     int anslen );

Library:

socket3r.lib, socket3s.lib

Description:

The res_querydomain() function provides an interface to the server query mechanism. It constructs a query, sends it to the local server, waits for a response, and makes preliminary checks on the reply. The query requests information of the specified type and class for the host specified by concatenating name and domain. The trailing dot is removed from name if domain is 0.

The reply message is left in the answer buffer with length anslen supplied by the caller.

Returns:

0
Success.
-1
An error occurred.

Files:

/etc/resolv.conf
Resolver configuration file.

Environment variables:

LOCALDOMAIN
When set, LOCALDOMAIN contains a domain name that overrides the current domain name.

Classification:

Unix

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

res_init(), res_query()


[Previous] [Contents] [Index] [Next]