Skip to main content

Name

dns_cache_lookup — Check to see if the results for a given query are in the DNS cache

Synopsis

#include "dns-cache.h"

| dns_cache_cachenode * **dns_cache_lookup** ( | query); |   |

dns_cache_query * <var class="pdparam">query</var>;

Description

Check to see if the results for a given query are in the DNS cache.

Parameters

query

The dns cache query. A pointer to a dns_cache_query struct. For documentation of this data structure see “dns_cache_query”

Return Values

This function returns a reference to a dns_cache_cachenode if present, or NULL if not present. For documentation of this data structure see “dns_cache_cachenode”.

Note

This function never blocks; it either has the answer in the cache or returns NULL.

Note

If the cachenode is returned, it is the caller's responsibility to release its reference by calling dns_cache_free_node when it has finished using it.

Threading

It is legal to call this function in any thread.

See Also

Was this page helpful?