Searches for a default domain name and Internet address.
Standard C Library (libc.a)
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
void res_init ( )
The res_init subroutine reads the /etc/resolv.conf file for the default domain name and the Internet address of the initial hosts running the name server.
The res_init subroutine is one of a set of subroutines that form the resolver, a set of functions that translate domain names to Internet addresses. All resolver subroutines use the /usr/include/resolv.h file, which defines the _res structure. The res_init subroutine stores domain name information in the _res structure. Three environment variables, LOCALDOMAIN, RES_TIMEOUT, and RES_RETRY, affect default values related to the _res structure.
All applications containing the res_init subroutine must be compiled with the _BSD macro set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
For more information on the _res structure, see "Understanding Domain Name Resolution" in AIX® Version 7.1 Communications Programming Concepts.
Item | Description |
---|---|
/etc/resolv.conf | Contains the name server and domain name. |
/etc/hosts | Contains host names and their addresses for hosts in a network. This file is used to resolve a host name into an Internet address. |