[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Files Reference

irs.conf File

Purpose

Specifies the ordering of certain name resolution services.

Description

The /etc/irs.conf file is used to specify the ordering mechanism lookups for network related data by the resolver libraries of AIX. Resolution of hostname, networks, services, protocols, and netgroups can be achieved by using the subroutines listed in the following table.

hostname gethostbyname, gethostaddr, gethostent
networks getnetbyname, getnetbyaddr, getnetent
services getservbyname, getservbyaddr, getservent
protocols getprotobyname, getprotobyaddr, getprotoent
netgroups getnetgrent

Because these routines 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.

The default order for lookup mechanisms for hosts is:

  1. Domain Name Server (DNS)
  2. Network Information Service (NIS), if active
  3. local

The default order for lookup mechanisms for networks is:

  1. DNS
  2. NIS, if active
  3. local.

The default order for lookup mechanisms for other maps is:

  1. NIS, if active
  2. local.

The default order can be overwritten by creating the configuration file, /etc/irs.conf, and specifying the desired ordering.

The settings in the configuration file /etc/netsvc.conf override the settings in the /etc/irs.conf file. The environment variable NSORDER overrides the settings in the /etc/irs.conf and the /etc/netsvc.conf files.

To use DNS to get information concerning netgroups, protocols, and services you must create and use a Hesiod DNS Zone.

<map> <mechanism> [<option>]

Available maps:

services Lists the port numbers, transport protocols, and names of well known services.
protocol Retrieves offical names and protocol numbers of protocol aliases.
hosts Defines the mappings between host names and their IP addresses.
networks Retrieves network names and addresses.
netgroup Retrieves groups of hosts, networks, and users in these group.

Available mechanisms:

local Examine local configuration files (/etc/hosts, /etc/protocols, /etc/services, /etc/netgroup, and /etc/networks files).
dns Get information from DNS. The /etc/resolv.conf file must be configured for this mechanism.
nis Get information from NIS. The NIS client must be active on the system to use this mechanism.
local4 Same as local but only looks for IPv4 addresses.
local6 Same as local but only looks IPv6 addresses.
dns4 Same as dns but only queries for A records (IPv4 addresses).
dns6 Same as dns but only queries for AAAA records (IPv6 addresses).
nis4 Same as nis but only looks for IPv4 addresses.
nis6 Same as nis but only looks for IPv6 addresses.

Available options:

continue If not found in [mechanism], then continue to the next line (which should list another mechanism for the same map).
merge Answers from all merged [mechanisms] into one response.

Examples:

An example of how to use [continue]:

Contents of /etc/irs.conf file:

     hosts local continue
     hosts dns continue
     hosts nis

Contents of /etc/hosts file:

     1.2.3.4 host4
     1.2.3.5 host5
     1.2.3.6 host6

Contents of DNS:

     1.2.3.2 host2
     1.2.3.3 host3

Contents of NIS:

     1.2.3.1 host1
Function Call: gethostbyname(host1)
Result: returns 1.2.3.1
Reason: The [continue] option will inform the resolver to first look for the information within the first mechanism, and if the requested information is not found, then continue to the next mechanism indicated in the /etc/irs.conf file. In this case, the resolver will first look at the local /etc/hosts file for host1 but will not find it. Next, it will look at the DNS, but again, will not find it. Finally, it will look at the NIS, find the address, and return 1.2.3.1.

An example of how to use [merge]:

Contents of /etc/irc.conf file:

     hosts local merge
     hosts dns

Contents of /etc/hosts file:

     1.1.1.1 hostname

Information in DNS:

     1.1.1.2 hostname
Function Call: gethostbyname(hostname)
Result: returns 1.1.1.1 1.1.1.2
Reason: The merge option indicates that the resolver should take all the answers from the selected mechanisms and merge the answers together into one reply.

Examples of the /etc/irs.conf file:

The following examples show how the irs.conf file should look to control the query order of different records per mechanism and map. These examples are not an exhaustive list; any combination of mechanism and map can be used.

To use only the local /etc/hosts file for hostname resolution, enter:

     hosts local

To use only the DNS for hostname resolution and NIS for protocols resolution, enter:

     hosts dns
     protocols nis

To use only NIS for hostname addresses and netgroup resolution and the local files for services and networks, enter:

     hosts nis
     services local
     netgroup nis
     networks local

To try to resolve host names from the local /etc/hosts file, then if they are not found, try to resolve from DNS, then NIS, enter:

     hosts local continue
     hosts dns continue
     hosts nis continue

To try to resolve host names from the local /etc/hosts file, merge any information found with any DNS information found, and then merge this information, if any, to any NIS information found. If no information is found, none is returned. If information is found in any source, it will return as merged information from all of the available sources. Enter:

     hosts local merge
     hosts dns merge
     hosts nis

To examine the local /etc/services file for port numbers before going to NIS. This can speed up the request since going to the NIS for information is much slower than going to the local file. If the information is not found in the local file, NIS will be searched. Enter:

     services local continue
     services nis

To look for IPv4 network addresses only from DNS and IPv6 host addresses only from the local file, enter:

     networks dns4
     hosts local6

Files

/etc/hosts Contains the Internet Protocol (IP) name and addresses of hosts on the local network.
/etc/protocols Contains offical 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 routines.
/etc/netsvc.conf Specifies the ordering of certain name resolution services.

Related Information

The ypbind daemon.

The gethostbyname, gethostbyaddr, and gethostent subroutines for hostnames.

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.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]