domain_name.h File Reference

Look up domain names and addresses directly. More...

Go to the source code of this file.

## Macros

#define | DOMAIN_NAME_MAX 256
| Maximum number of characters in a domain name or address.

## Functions

int | domain_name_lookup (const char *name, char *addr)
| Resolve a domain name to an IP address.
int | domain_name_lookup_reverse (const char *addr, char *name)
| Resolve an IP address to a domain name with caching.

## Detailed Description

Look up domain names and addresses directly.

Most applications should use domain_name_cache.h, which uses an internal cache to perform lookups quickly.

## Macro Definition Documentation

## DOMAIN_NAME_MAX

#define DOMAIN_NAME_MAX 256

Maximum number of characters in a domain name or address.

## Function Documentation

## domain_name_lookup()

int domain_name_lookup | ( | const char * | name,
|  | char * | addr )

Resolve a domain name to an IP address.

Parameters

  name | A string containing a domain name like "www.google.com".
  addr | A string where the IP address will be written.

Returns
  One on success, zero on failure.

## domain_name_lookup_reverse()

int domain_name_lookup_reverse | ( | const char * | addr,
|  | char * | name )

Resolve an IP address to a domain name with caching.

Parameters

  addr | A string containing an IP address like "202.5.129.1"
  name | A string where the domain name will be written.

Returns
  One on success, zero on failure.