Specifies the ordering of certain name resolution services.
The /etc/irs.conf file is used to control the order of
mechanisms that the resolver libraries use in searching for network-related
data. The following subroutines resolve host names, networks, services,
protocols, and netgroups:
host names | gethostbyname, gethostaddr, gethostent |
networks | getnetbyname, getnetbyaddr, getnetent |
services | getservbyname, getservbyaddr, getservent |
protocols | getprotobyname, getprotobyaddr, getprotoent |
netgroups | getnetgrent |
Because these subroutines are commonly used in many TCP/IP applications, using the irs.conf file can control the directions of the queries made by these applications as well.
By default, the subroutines use the lookup mechanisms to resolve host names in this order:
By default, the subroutines use the lookup mechanisms to resolve networks in this order:
By default, the subroutines use the lookup mechanisms to resolve other maps in this order:
You can override the default order by modifying the /etc/irs.conf configuration file and specifying the desired ordering.
The settings in the /etc/netsvc.conf configuration file override the settings in the /etc/irs.conf file. The NSORDER environment variable overrides the settings in the /etc/irs.conf and the /etc/netsvc.conf files.
To use DNS to obtain information concerning netgroups, protocols, and services, you must create and use a Hesiod DNS Zone in the following format:
map mechanism [option]
The following values are available for the map parameter:
The following values are available for the mechanism
parameter:
local | Examines local configuration files (/etc/hosts, /etc/protocols, /etc/services, /etc/netgroup, and /etc/networks files) |
dns | Queries DNS; the /etc/resolv.conf file must be configured for this mechanism to work |
nis | Queries NIS; the NIS client must be active on the system for this mechanism to work |
nis+ | Queries NIS+; The NIS+ client must be active on the system for this mechanism to work |
ldap | Queries the LDAP server; the resolv.ldap file must be configured
for this mechanism to work
Note: You can only assign the value hosts to the map parameter for ldap. |
local4 | Examines local configuration files for IPv4 addresses |
local6 | Examines local configuration files for IPv6 addresses |
dns4 | Queries DNS for A records (IPv4 addresses); the /etc/resolv.conf file must be configured for this mechanism to work |
dns6 | Queries DNS for AAAA records (IPv6 addresses); the /etc/resolv.conf file must be configured for this mechanism to work |
nis4 | Queries NIS for information about IPv4 addresses; the NIS client must be active on the system to use this mechanism |
nis6 | Queries NIS for information about IPv6 addresses; the NIS client must be active on the system to use this mechanism |
ldap4 | Queries the LDAP server for information about IPv4 addresses |
ldap6 | Queries the LDAP server for information about IPv6 addresses |
The following values are available for the option
parameter:
continue | If the information is not found in the specified mechanism, then instructs the resolver to continue to the next line, which should list another mechanism for the same map |
merge | Merges all responses from multiple mechanism parameters into one response |
hosts local
hosts local continue hosts ldap
hosts dns protocols nis
hosts nis services local netgroup nis networks local
hosts local continue hosts dns continue hosts nis continue
hosts local merge hosts dns merge hosts nis
If the resolver finds no information, it returns none. If it finds information from more than one source, it returns that information as a merged response from all of the available sources.
services local continue services nis
This entry in the /etc/irs.conf file could speed up the request; normally, querying NIS takes more time than querying the local file. If the resolver does not find the information in the local file, it searches NIS.
networks dns4 hosts local6
1.2.3.4 host4 1.2.3.5 host5 1.2.3.6 host6
1.2.3.2 host2 1.2.3.3 host3
1.2.3.1 host1
To instruct the gethostbyname subroutine to look for the host name first in the local configuration files, then to continue to search in DNS if the host name is not found, and finally to continue searching in NIS if the host name is not found, create the following entry in the /etc/irs.conf file:
hosts local continue hosts dns continue hosts nis
In this example, the gethostbyname subroutine cannot find the host name in the /etc/hosts file and continues to search for the host name in DNS. After not finding it in DNS, it continues to search in NIS. After finding the address in NIS, it returns 1.2.3.1.
1.1.1.1 hostname
1.1.1.2 hostname
To instruct the gethostbyname subroutine to merge all the answers from the specified mechanisms into one reply, create the following entry in the /etc/irs.conf file:
hosts local merge hosts dns
The gethostbyname subroutine returns 1.1.1.1 1.1.1.2.
/etc/hosts | Contains the Internet Protocol (IP) name and addresses of hosts on the local network |
/etc/protocols | Contains official names and protocol numbers of protocol aliases |
/etc/services | Contains lists of the port numbers, transport protocols, and names of well-known services |
/etc/netgroup | Contains a list of groups of hosts, networks, and users in these groups |
/etc/networks | Contains a list of network names and addresses |
/etc/resolv.conf | Contains Domain Name Protocol (DOMAIN) name-server information for local resolver subroutines |
/etc/netsvc.conf | Specifies the ordering of certain name resolution services |
/etc/resolv.ldap | Contains the IP address of the LDAP server |
The hosts file format for TCP/IP, netgroup file for NIS, netsvc.conf file, networks file format for TCP/IP, protocols file format for TCP/IP, resolv.conf file format for TCP/IP, resolv.ldap file format for TCP/IP, services file format for TCP/IP.
The ypbind daemon.
The gethostbyname, gethostbyaddr, and gethostent subroutines for host names.
The getnetbyname, getnetbyaddr, getnetent subroutines for networks.
The getservbyname, getservbyport, getservent subroutines for services.
The getprotobyname, getprotobynumber, getprotoent subroutines for protocols.
The getnetgrent subroutine for netgroups.