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_querydomain.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_querydomain.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_querydomain.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_querydomain.html on line 8
Query the local Internet domain name server
#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 );
- name
- The host name that you want to query.
- domain
- The domain name that you want to query.
- class
- The class of information that you want; one of:
- C_IN — ARPA Internet.
- C_CHAOS — Chaos net (MIT).
- C_HS — Hesiod name server (MIT).
- C_ANY — any class.
You typically use C_IN.
- type
- The type of information that you want.
You typically use T_PTR, but you can use any of the
T_* constants defined in <arpa/nameser.h>.
- answer
- A pointer to a buffer where the function can store the answer to the
query.
- anslen
- The length of the buffer.
libsocket
Use the -l socket option to
qcc
to link against this library.
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.
- 0
- Success.
- -1
- An error occurred.
- /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 |
res_init(),
res_query()
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_querydomain.html on line 208
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_querydomain.html on line 208