[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Files Reference


netsvc.conf File

Purpose

Specifies the ordering of certain name resolution services.

Description

The /etc/netsvc.conf file is used to specify the ordering of name resolution for the sendmail command, gethostbyname subroutine, gethostaddr subroutine, and gethostent subroutine and alias resolution for the sendmail command.

Several mechanisms for resolving host names and aliases are available. The gethostbyname, gethostbyaddr, and gethostent subroutines use these mechanisms for resolving names. A default order exists in which the resolver subroutines try the mechanisms for resolving host names and Internet Protocol (IP) addresses.

Resolving Host Names

You can override the default order and the order given in the /etc/irs.conf file by creating the /etc/netsvc.conf configuration file and specifying the desired ordering. To specify this host ordering, create an entry in the following format:

hosts = value [, value]

Use one or more of the following values for the hosts keyword:

auth Designates the specified server as authoritative. A resolver does not continue searching for host names further than an authoritative server. For example, when two services are given as values for the host keyword and the first service is made authoritative, and if the resolver cannot find the host name in the authoritative service, then the resolver terminates its search. However, the auth option has no effect if the resolver is unable to contact the authoritative server; in this case, the resolver continues to search the next service given in the same entry.

Indicate that the specified service is authoritative by following it by an = and then auth.

Note: The auth option is only valid when used in conjunction with a service value for the host keyword.
bind Uses BIND/DNS services for resolving names
local Searches the local /etc/hosts file for resolving names
nis Uses NIS services for resolving names. NIS must be running if you specify this option
ldap Uses LDAP services for resolving names
bind4 Uses BIND/DNS services for resolving only IPv4 addresses
bind6 Uses BIND/DNS services for resolving only IPv6 addresses
local4 Searches the local /etc/hosts file for resolving only IPv4 addresses
local6 Searches the local /etc/hosts file for resolving only IPv6 addresses
nis4 Uses NIS services for resolving only IPv4 addresses
nis6 Uses NIS services for resolving only IPv6 addresses
ldap4 Uses LDAP services for resolving only IPv4 addresses
ldap6 Uses LDAP services for resolving only IPv6 addresses

The environment variable NSORDER overrides the host settings in the /etc/netsvc.conf file, which in turn overrides the host settings in the /etc/irs.conf file.

Resolving Aliases

The sendmail command searches the local /etc/aliases file, or uses NIS if specified for resolving aliases. You can override the default by specifying how to resolve aliases in the /etc/netsvc.conf file. To specify alias ordering to the sendmail command, enter the following:

alias = value [, value]

Use one or more of the following values for the alias keyword:

files Searches the local /etc/aliases file for the alias
nis Uses NIS services for resolving alias

The order is specified on one line with values separated by commas. White spaces are permitted around the commas and the equal sign. The values specified and their ordering are dependent on the network configuration.

Examples

  1. To use only the /etc/hosts file for resolving names, enter:

    hosts = local
    
  2. If the resolver cannot find the name in the /etc/hosts file and you want to the resolver to use NIS, enter:

    hosts = local , nis
    
  3. To use the LDAP server for resolving names, indicate that it is authoritative, and to also use the BIND service, enter:

    hosts = ldap = auth , bind
    

    In this example, if the resolver cannot contact the LDAP server, then it searches the BIND service.

  4. To override the default order and use only NIS for resolving aliases by the sendmail command, enter:

    aliases = nis
    

Files


/etc/netsvc.conf Specifies the path to the file.

Related Information

The aliases file for mail, irs.conf file, hosts file format for TCP/IP.

The sendmail command.

The gethostbyname subroutine, gethostbyaddr subroutine, and gethostent subroutine.

TCP/IP Name Resolution in AIX 5L Version 5.1 System Management Guide: Communications and Networks


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]