Instructs Traffic Server to do a DNS lookup on a host name.
INKAction INKHostLookupResult (INKCont
contp
, char
*hostname
, int
namelen
)
INKCont
is the
continuation Traffic Server calls back when the DNS lookup
occurs.contp
char
*
is the
name to look up. Null-terminated.hostname
int
is the
length of namelen
+1
(add one to account for null termination).hostname
Initiates a DNS lookup of
. When the
lookup occurs, Traffic Server sends contp
hostname
INK_EVENT_DNS_LOOKUP
. If the lookup is successful
(IP address resolved), then the void *
passed to
the handler of the continuation
data
is a data of type
contp
INKHostLookupResult
. You can then use
INKHostLookupResultIPGet
to convert this
information to an unsigned int
representing the IP
address.
If the lookup fails (IP address not resolved), then the
void *
passed to the handler of continuation
data
is a null
pointer.contp
You have the option to cancel the action returned by
INKHostLookup
by using
INKActionCancel
.
Note | |
---|---|
Reentrant calls are possible; i.e., the cache can call
back the user ( |
An INKAction
object if
successful.
INK_ERROR_PTR
if an argument is incorrect or
if the API fails.