res_init()

The res_init() call initializes the default domain name.

Syntax

#include <types.h>
#include <netinet\in.h>
#include <arpa\nameser.h>
#include <resolv.h>
void res_init()

Description

This call reads the ETC\RESOLV and ETC\RESOLV2 files for the domain name information and for the IP addresses of the initial hosts running the name server. If none of these files exist, name resolution will use the ETC\HOSTS file. One of these files should be operational.

Note: If the ETC\RESOLV files do not exist, the res_init() call attempts name resolution using the local ETC\HOSTS file. If the system is not using a domain name server, the ETC\RESOLV file should not exist. The ETC\HOSTS file should be present on the system even if the system is using a name server. In this instance, the file should contain the host IDs that the system requires to function even if the name server is not functioning.

The res_init() call is one of a group of calls that form the resolver. The resolver is a set of functions that perform a translation between domain names and network addresses. Global information used by the resolver calls resides in the _res data structure. The <RESOLV.H> file contains the _res data structure definition. (See The _res Data Structure for more on the _res data structure.)

Related Calls


[Back: Rconnect()]
[Next: res_mkquery()]