1
2getdns_hostname(3) getdns getdns_hostname(3)
3
4
5
7 getdns_hostname, getdns_hostname_sync -- get hostname by address
8
9
11 DNS Resolver library (libgetdns, -lgetdns)
12
13
15 #include <getdns.h>
16
17 getdns_return_t
18 getdns_hostname (getdns_context *context,
19 getdns_dict *address,
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_hostname_sync (getdns_context *context,
27 getdns_dict *address,
28 getdns_dict *extensions,
29 getdns_dict **response)
30
31
33 The getdns_hostname(3) and getdns_hostname_sync functions provide pub‐
34 lic entry points into the getdns API library to retrieve the host name
35 given an address.
36
37
38 context A pointer to the previously created DNS context that is to be
39 used with this DNS request. see getdns_context (3)
40
41
42 address a getdns_dict structure containing two names: address_type
43 (whose value is bindata and is either "IPv4" or "IPv6") and
44 address_data whose value is bindata
45
46
47 extensions extensions for this request, NULL if no extensions, see
48 libgetdns (3) for a detailed description of extensions
49
50
51 userarg returned to the callback function untouched, can be NULL
52
53
54 transaction_id populated by the API and used to identify the callback
55 (for example to getdns_cancel_callback), can be NULL, set to 0 if
56 the function fails
57
58
59 callbackfn non-NULL pointer to a callback function defined by the
60 application, typically used to process the response. Only the asyn‐
61 chronous signature accepts a callback function, the synchronous sig‐
62 nature does not include a callback. See libgetdns (3) for a more
63 detailed discussion of callback functions.
64
65
66 response A getdns_dict type is returned in response and always contains
67 at least three names: replies_full (a list containing the DNS
68 response as binary data), replies_tree (a list containing the parsed
69 DNS response data) and status (an int). The storage associated with
70 this must be freed by a call to getdns_free_sync_request_memory (3).
71
72
73
74
76 Upon successful completion the functions return GETDNS_RETURN_GOOD ,
77 otherwise the following error values are returned:
78
79
80 GETDNS_RETURN_BAD_CONTEXT if the context pointer is invalid or the con‐
81 text has internal deficiencies
82
83 GETDNS_RETURN_BAD_DOMAIN_NAME if the domain name passed to the function
84 is invalid
85
86 GETDNS_RETURN_EXTENSION_MISFORMAT if the data type specified in one or
87 more of the extensions does not match the specifications
88
89 GETDNS_RETURN_GENERIC_ERROR if some problem was encountered in the
90 function not addressed by one of the more specific return codes
91
92 GETDNS_RETURN_INVALID PARAMETER if one or more parameters has an
93 invalid value
94
95 GETDNS_RETURN_MEMORY_ERROR if unable to allocate the memory required
96
97 GETDNS_RETURN_NO_SUCH_EXTENSION if one or more of the strings specified
98 in the extensions are not valid
99
100 The values of status included in the response parameter are:
101
102
103 GETDNS_RESPSTATUS_GOOD if at least one response was returned
104
105 GETDNS_RESPSTATUS_NO_NAME if queries for the name yielded all negative
106 responses
107
108 GETDNS_RESPSTATUS_ALL_TIMEOUT if all queries for the name timed out
109
110 GETDNS_RESPSTATUS_NO_SECURE_ANSWERS if only secure replies accepted
111 (per context) and at least one response was received but no DNS
112 responses were secure through DNSSEC
113
114
115 For a more detailed explanation of the response object see libgetdns
116 (3)
117
118
120 TBD
121
122
124 /etc/hosts
125 /etc/resolv.conf
126
127
129 libgetdns(3), getdns_context(3), getdns_free_sync_request_memory(3),
130 getdns_general(3), getdns_address(3), getdns_service(3),
131
132
133
134
135getdns 1.6.0 December 2015 getdns_hostname(3)