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:
Value | Description |
---|---|
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 |
nis_ldap | Uses LDAP services for resolving names. This option works if LDAP server schema is RFC 2307 compliant. |
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 |
nis_ldap4 | Uses NIS LDAP services for resolving names for IPv4 addresses |
nis_ldap6 | Uses NIS LDAP services for resolving names for 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:
Value | Description |
---|---|
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
- To use only the /etc/hosts file for resolving names, enter:
hosts = local
- 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
- To use an LDAP server for resolving names, to
indicate that it is authoritative, and to also use the BIND service,
enter: z`
host = nis_ldap = auth , bind
In this example, if the resolver cannot contact the LDAP server, it searches the BIND service.
- To override the default order and use only NIS for resolving aliases
by the sendmail command, enter:
aliases = nis
Files
Item | Description |
---|---|
/etc/netsvc.conf | Specifies the path to the file. |