res_querydomain() — Build domain name and resolver query

Standards

Standards / Extensions C or C++ Dependencies

BSD 4.3

both OS/390 V2R8

Format

#define _XOPEN_SOURCE_EXTENDED 1
#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);

General description

This routine is one of several functions used for making, sending and interpreting query and reply messages with Internet domain name servers (DNS).

The res_querydomain() function builds a fully qualified domain name and returns a res_query() to the caller.

Note: The res_querydomain() function has a dependency on the level of the Enhanced ASCII Extensions. See Enhanced ASCII support for details.

Returned value

If successful, res_querydomain() returns a res_query() to the caller.

If unsuccessful, res_querydomain() returns -1 and sets herrno to one of the following values:
Error Code
Description
HOST_NOT_FOUND
The host name provided is not known at any of the domain name servers queried for this request.
NO_DATA
An answer was received but no data was supplied in the answer buffer.
NO_RECOVERY
An error occurred that will continue to fail if tried again.
TRY_AGAIN
A error occurred querying the name selected, which can be retried.

Related information