1
2getdns_address(3)                   getdns                   getdns_address(3)
3
4
5

NAME

7       getdns_address, getdns_address_sync -- get ip address(es) for a name
8
9

LIBRARY

11       DNS Resolver library (libgetdns, -lgetdns)
12
13

SYNOPSIS

15       #include <getdns.h>
16
17       getdns_return_t
18       getdns_address (getdns_context *context,
19          const char *name,
20          getdns_dict *extensions,
21          void *userarg,
22          getdns_transaction_t *transaction_id,
23          getdns_callback_t callbackfn)
24
25       getdns_return_t
26       getdns_address_sync (getdns_context *context,
27          const char *name,
28          getdns_dict *extensions,
29          getdns_dict **response)
30
31

DESCRIPTION

33       The  getdns_address(3) and getdns_address_sync functions provide public
34       entry points into the getdns API library to retrieve the address  given
35       a  host  name.  They always returns both IPv4 and IPv6 addresses.  This
36       function will use all of the namespaces from  the  context  (to  better
37       emulate getaddrinfo (3)).
38
39
40       context  A  pointer to the previously created DNS context that is to be
41          used with this DNS request. see getdns_context (3)
42
43
44       name the host name to resolve to an address (note that an IP address is
45          considered invalid)
46
47
48       extensions  extensions  for  this  request,  NULL if no extensions, see
49          libgetdns (3) for a detailed description of extensions
50
51
52       userarg returned to the callback function untouched, can be NULL
53
54
55       transaction_id populated by the API and used to identify  the  callback
56          (for  example  to  getdns_cancel_callback), can be NULL, set to 0 if
57          the function fails
58
59
60       callbackfn non-NULL pointer to  a  callback  function  defined  by  the
61          application,  typically used to process the response. Only the asyn‐
62          chronous signature accepts a callback function, the synchronous sig‐
63          nature  does  not  include a callback.  See libgetdns (3) for a more
64          detailed discussion of callback functions.
65
66
67       response A getdns_dict type is returned in response and always contains
68          at  least  three  names:  replies_full  (a  list  containing the DNS
69          response as binary data), replies_tree (a list containing the parsed
70          DNS response data) and status (an int).  The storage associated with
71          this must be freed by a call to getdns_free_sync_request_memory (3).
72
73
74
75

RETURN VALUES

77       Upon successful completion the functions  return  GETDNS_RETURN_GOOD  ,
78       otherwise the following error values are returned:
79
80
81       GETDNS_RETURN_BAD_CONTEXT if the context pointer is invalid or the con‐
82       text has internal deficiencies
83
84       GETDNS_RETURN_BAD_DOMAIN_NAME if the domain name passed to the function
85       is invalid
86
87       GETDNS_RETURN_EXTENSION_MISFORMAT  if the data type specified in one or
88       more of the extensions does not match the specifications
89
90       GETDNS_RETURN_GENERIC_ERROR if some  problem  was  encountered  in  the
91       function not addressed by one of the more specific return codes
92
93       GETDNS_RETURN_INVALID  PARAMETER  if  one  or  more  parameters  has an
94       invalid value
95
96       GETDNS_RETURN_MEMORY_ERROR if unable to allocate the memory required
97
98       GETDNS_RETURN_NO_SUCH_EXTENSION if one or more of the strings specified
99       in the extensions are not valid
100
101       The values of status included in the response parameter are:
102
103
104       GETDNS_RESPSTATUS_GOOD if at least one response was returned
105
106       GETDNS_RESPSTATUS_NO_NAME  if queries for the name yielded all negative
107       responses
108
109       GETDNS_RESPSTATUS_ALL_TIMEOUT if all queries for the name timed out
110
111       GETDNS_RESPSTATUS_NO_SECURE_ANSWERS if  only  secure  replies  accepted
112       (per  context)  and  at  least  one  response  was  received but no DNS
113       responses were secure through DNSSEC
114
115
116       For a more detailed explanation of the response  object  see  libgetdns
117       (3)
118
119

EXAMPLES

121       TBD
122
123

FILES

125       /etc/hosts
126       /etc/resolv.conf
127
128

SEE ALSO

130       libgetdns(3),   getdns_context(3),  getdns_free_sync_request_memory(3),
131       getdns_general(3),     getdns_general_sync(3),      getdns_hostname(3),
132       getdns_hostname_sync(3), getdns_service(3), getdns_service_sync(3)
133
134
135
136
137getdns 1.6.0                     December 2015               getdns_address(3)
Impressum