Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/res_init.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/res_init.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/res_init.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/res_init.html on line 8
Initialize the Internet domain name resolver routines
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
int res_init( void );
libsocket
Use the -l socket option to
qcc
to link against this library.
The resolver routines are used for making, sending, and
interpreting query and reply messages with Internet domain
name servers.
The res_init() routine reads the resolver configuration
file (if one is present; see
/etc/resolv.conf
in the Utilities Reference)
to get the default domain name, search list, and
Internet address of the local name servers. If no server is
configured, the host running the resolver is tried. If not
specified in the configuration file, the current domain name
is defined by the hostname; the domain name can be
overridden by the environment variable LOCALDOMAIN.
Initialization normally occurs on the first call to one of
the resolver routines.
Global configuration and state information used by these
routines is kept in the __res_state structure _res,
which is defined in <resolv.h>. Since most
of the values have reasonable defaults, you can generally
ignore them.
The _res.options member is a
simple bit mask that contains the bitwise OR of the enabled options.
The following options are defined in
<resolv.h>:
- RES_DEBUG
- Print debugging messages.
- RES_DEFNAMES
- If this option is set,
res_search()
appends the default domain name to single-component names
(those that don't contain a dot). This option is enabled by
default.
- RES_DNSRCH
- If this option is set, res_search()
searches for hostnames in the current domain and in parent
domains. This is used by the standard host lookup routine,
gethostbyname().
This option is enabled by default.
- RES_INIT
- True if the initial name server address and default
domain name are initialized (i.e. res_init() has
been called).
- RES_RECURSE
- Set the recursion-desired bit in queries. This is the
default. Note that
res_send()
doesn't do
iterative queries — it expects the name server to
handle recursion.
- RES_STAYOPEN
- Used with RES_USEVC to keep the TCP connection open
between queries. This is useful only in programs that
regularly do many queries. UDP should be the mode you
normally use.
- RES_USEVC
- Instead of UDP datagrams, use TCP connections for queries.
- 0
- Success.
- Nonzero
- An error occurred.
See herror().
- /etc/resolv.conf
- Resolver configuration file.
- LOCALDOMAIN
- When set, LOCALDOMAIN contains a domain name that overrides the
current domain name.
Unix
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
dn_comp(),
dn_expand(),
gethostbyname(),
res_mkquery(),
res_query(),
res_querydomain(),
res_search(),
res_send()
hostname,
/etc/resolv.conf
in the Utilities Reference
Based on
RFC 974, RFC 1032, RFC 1033, RFC 1034, RFC 1035
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/res_init.html on line 259
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/res_init.html on line 259