Network Interface Guide

/etc/netconfig File

The netconfig(4) file describes all transport protocols on a host. The entries in the netconfig(4) file are explained briefly in Table 4-1 and in more detail in the netconfig(4) man page.

Table 4-1 netconfig(4) File



network ID

A local representation of a transport name (such as tcp). Do not assume that this field contains a well-known name (such as tcp or udp) or that two systems use the same name for the same transport.


The semantics of the particular transport protocol. Valid semantics are:

  • tpi_clts - connectionless

  • tpi_cots - connection oriented

  • tpi_cots_ord - connection oriented with orderly release


Can take only the values, v, or hyphen (-). Only the visible flag (-v) is defined.

protocol family

The protocol family name of the transport provider (for example, inet or loopback).

protocol name

The protocol name of the transport provider. For example, if protocol family is inet, then protocol name is tcp, udp, or icmp. Otherwise, the value of protocol name is a hyphen (-).

network device

The full path name of the device file to open when accessing the transport provider 

name-to-address translation libraries

Names of the shared objects. This field contains the comma-separated file names of the shared objects that contain name-to-address mapping routines. Shared objects are located through the path in the LD_LIBRARY_PATH variable. A "-" in this field indicates redirection to the name service switch policies for hosts and services.

Example 4-1 shows a sample netconfig(4) file. Use of the netconfig(4) file has been changed for the inet transports, as described in the commented section in the sample file. This change is also described in "Name-to-Address Mapping".

Example 4-1 Sample netconfig(4) File

# The "Network Configuration" File.
# Each entry is of the form:
#<net <semantics>  <flags> <proto    <proto   <device>    	<nametoaddr_libs>
# id>                       family>   name>
# The "-" in <nametoaddr_libs> for inet family transports indicates redirection
# to the name service switch policies for "hosts" and "services. The "-" may be
# replaced by nametoaddr libraries that comply with the SVR4 specs, in which
# case the name service switch will be used for netdir_getbyname, netdir_
# getbyaddr, gethostbyname, gethostbyaddr, getservbyname, and getservbyport.
# There are no nametoaddr_libs for the inet family in Solaris anymore.
udp       tpi_clts     v   inet       udp      /dev/udp        -
tcp       tpi_cots_ord v   inet       tcp      /dev/tcp        -
icmp      tpi_raw      -   inet       icmp     /dev/icmp       -
rawip     tpi_raw      -   inet       -        /dev/rawip      -
ticlts    tpi_clts     v   loopback   -        /dev/ticlts
ticots    tpi_cots     v   loopback   -        /dev/ticots
ticotsord tpi_cots_ord v   loopback   -        /dev/ticotsord

Network selection library routines return pointers to netconfig entries. The netconfig structure is shown in Example 4-2.

Example 4-2 netconfig Structure

struct netconfig {
   char  *nc_netid;                /* network identifier */
   unsigned  int   nc_semantics;   /* semantics of protocol */
   unsigned  int   nc_flag;        /* flags for the protocol */
   char *nc_protofmly;             /* family name */
   char *nc_proto;                 /* proto specific */
   char *nc_device;                /* device name for network id */
   unsigned  int   nc_nlookups;    /* # entries in nc_lookups */
   char **nc_lookups;              /* list of lookup libraries */
   unsigned  int   nc_unused[8];

Valid network IDs are defined by the system administrator, who must ensure that network IDs are locally unique. If they are not, some network selection routines can fail. For example, it is not possible to know which network getnetconfigent("udp") will use if there are two netconfig entries with the network ID udp.

The system administrator also sets the order of the entries in the netconfig(4) database. The routines that find entries in /etc/netconfig return them in order, from the beginning of the file. The order of transports in the netconfig(4) file is the default transport search sequence of the routines. Loopback entries should be at the end of the file.

The netconfig(4) file and the netconfig structure are described in greater detail in the netconfig(4) man page.