Manual Pages for Linux CentOS command on man res_querydomain
MyWebUniversity

Manual Pages for Linux CentOS command on man res_querydomain

RESOLVER(3) Linux Programmer's Manual RESOLVER(3)

NAME resinit, resquery, ressearch, resquerydomain, resmkquery,

ressend, dncomp, dnexpand - resolver routines SYNOPSIS

#include

#include

#include extern struct state res; int resinit(void); int resquery(const char *dname, int class, int type, unsigned char *answer, int anslen); int ressearch(const char *dname, int class, int type, unsigned char *answer, int anslen); int resquerydomain(const char *name, const char *domain, int class, int type, unsigned char *answer, int anslen); int resmkquery(int op, const char *dname, int class, int type, char *data, int datalen, struct rrec *newrr, char *buf, int buflen); int ressend(const char *msg, int msglen, char *answer, int anslen); int dncomp(unsigned char *expdn, unsigned char *compdn, int length, unsigned char **dnptrs, unsigned char **lastdnptr); int dnexpand(unsigned char *msg, unsigned char *eomorig, unsigned char *compdn, char *expdn, int length);

Link with -lresolv. DESCRIPTION These functions make queries to and interpret the responses from Inter‐ net domain name servers. The resinit() function reads the configuration files (see resolv.conf(5)) to get the default domain name, search order and name server address(es). If no server is given, the local host is tried. If no domain is given, that associated with the local host is used. It can be overridden with the environment variable LOCALDOMAIN. resinit() is normally executed by the first call to one of the other functions. The resquery() function queries the name server for the fully quali‐ fied domain name name of specified type and class. The reply is left in the buffer answer of length anslen supplied by the caller. The ressearch() function makes a query and waits for the response like resquery(), but in addition implements the default and search rules controlled by RESDEFNAMES and RESDNSRCH (see description of res options below). The resquerydomain() function makes a query using resquery() on the concatenation of name and domain.

The following functions are lower-level routines used by resquery(). The resmkquery() function constructs a query message in buf of length buflen for the domain name dname. The query type op is usually QUERY, but can be any of the types defined in . newrr is cur‐ rently unused. The ressend() function sends a preformatted query given in msg of length msglen and returns the answer in answer which is of length anslen. It will call resinit(), if it has not already been called. The dncomp() function compresses the domain name expdn and stores it in the buffer compdn of length length. The compression uses an array of pointers dnptrs to previously compressed names in the current mes‐ sage. The first pointer points to the beginning of the message and the list ends with NULL. The limit of the array is specified by lastdnptr. If dnptr is NULL, domain names are not compressed. If lastdnptr is NULL, the list of labels is not updated. The dnexpand() function expands the compressed domain name compdn to a full domain name, which is placed in the buffer expdn of size length. The compressed name is contained in a query or reply message, and msg points to the beginning of the message. The resolver routines use global configuration and state information contained in the structure res, which is defined in . The only field that is normally manipulated by the user is res.options. This field can contain the bitwise "OR" of the following options: RESINIT True if resinit() has been called. RESDEBUG Print debugging messages. This option is available only if glibc was built with debugging enabled, which is not the default. RESAAONLY Accept authoritative answers only. ressend() continues until it finds an authoritative answer or returns an error. [Not cur‐ rently implemented]. RESUSEVC Use TCP connections for queries rather than UDP datagrams. RESPRIMARY Query primary domain name server only. RESIGNTC Ignore truncation errors. Don't retry with TCP. [Not currently implemented]. RESRECURSE Set the recursion desired bit in queries. Recursion is carried out by the domain name server, not by ressend(). [Enabled by default]. RESDEFNAMES If set, ressearch() will append the default domain name to sin‐ gle component names, i.e., those that do not contain a dot. [Enabled by default]. RESSTAYOPEN Used with RESUSEVC to keep the TCP connection open between queries. RESDNSRCH If set, ressearch() will search for hostnames in the current domain and in parent domains. This option is used by gethostby‐ name(3). [Enabled by default]. This list is not complete. You can find some other flags described in resolv.conf(5). RETURN VALUE

The resinit() function returns 0 on success, or -1 if an error occurs. The resquery(), ressearch(), resquerydomain(), resmkquery() and

ressend() functions return the length of the response, or -1 if an error occurs. The dncomp() and dnexpand() functions return the length of the com‐

pressed name, or -1 if an error occurs. FILES /etc/resolv.conf resolver configuration file /etc/host.conf resolver configuration file CONFORMING TO 4.3BSD. SEE ALSO gethostbyname(3), resolv.conf(5), resolver(5), hostname(7), named(8) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

GNU 2013-03-05 RESOLVER(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™