netconfig - network configuration database
The network configuration database, /etc/netconfig, is a system file
used to store information about networks that are connected to the sys‐
tem. The netconfig database and the routines that access it (see get‐
netconfig(3NSL)) are part of the Network Selection component. The Net‐
work Selection component also includes getnetpath(3NSL) routines to
provide application-specific network search paths. These routines
access the netconfig database based on the environment variable NET‐
PATH. See environ(5).
netconfig contains an entry for each network available on the system.
Entries are separated by newlines. Fields are separated by whitespace
and occur in the order in which they are described below. Whitespace
can be embedded as ``\blank'' or ``\tab''. Backslashes may be embedded
as ``\\''. Lines in /etc/netconfig that begin with a # (hash) in column
1 are treated as comments.
Each of the valid lines in the netconfig database correspond to an
available transport. Each entry is of the form:
network ID semantics flag protocol-family \
protocol-name network-device translation-libraries
A string used to uniquely identify a network.
network ID consists of non-null characters,
and has a length of at least 1. No maximum
length is specified. This namespace is locally
significant and the local system administrator
is the naming authority. All network IDs on a
system must be unique.
The semantics field is a string identifying
the ``semantics'' of the network, that is, the
set of services it supports, by identifying
the service interface it provides. The seman‐
tics field is mandatory. The following seman‐
tics are recognized.
Transport Provider Interface,
Transport Provider Interface,
Transport Provider Interface,
connection oriented, supports
The flag field records certain two-valued
(``true'' and ``false'') attributes of net‐
works. flag is a string composed of a combina‐
tion of characters, each of which indicates
the value of the corresponding attribute. If
the character is present, the attribute is
``true.'' If the character is absent, the
attribute is ``false.'' ``-'' indicates that
none of the attributes are present. Only one
character is currently recognized:
Visible (``default'') network. Used when
the environment variable NETPATH is
The protocol family and protocol name fields
are provided for protocol-specific applica‐
tions. The protocol family field contains a
string that identifies a protocol family. The
protocol family identifier follows the same
rules as those for network IDs; the string
consists of non-null characters, it has a
length of at least 1, and there is no maximum
length specified. A ``−'' in the protocol fam‐
ily field indicates that no protocol family
identifier applies (the network is experimen‐
tal). The following are examples:
Loopback (local to host).
Internetwork: UDP, TCP, and the
Internetwork over IPv6: UDP, TCP,
and the like.
ARPANET imp addresses
PUP protocols: for example, BSP
MIT CHAOS protocols
XEROX NS protocols
European Computer Manufacturers
CCITT protocols, X.25, and the
Direct data link interface
Network Interface Tap
IEEE 802.2; also ISO 8802
Umbrella for all families used by
OSI (for example, protosw lookup)
CCITT X.25 in particular
AFI = 47, IDI = 4
U.S. Government OSI
The protocol name field contains a string that
identifies a protocol. The protocol name iden‐
tifier follows the same rules as those for
network IDs; that is, the string consists of
non-NULL characters, it has a length of at
least 1, and there is no maximum length speci‐
fied. A ``−'' indicates that none of the names
listed apply. The following protocol names are
Transmission Control Protocol
User Datagram Protocol
Internet Control Message Protocol
The network device is the full pathname of the
device used to connect to the transport
provider. Typically, this device will be in
the /dev directory. The network device must be
The name-to-address translation libraries sup‐
port a ``directory service'' (a name-to-
address mapping service) for the network. A
``−'' in this field indicates the absence of
any translation libraries. This has a special
meaning for networks of the protocol family
inet : its name-to-address mapping is provided
by the name service switch based on the
entries for hosts and services in nss‐
witch.conf(4). For networks of other families,
a ``−'' indicates non-functional name-to-
address mapping. Otherwise, this field con‐
sists of a comma-separated list of pathnames
to dynamically linked libraries. The pathname
of the library can be either absolute or rela‐
tive. See dlopen(3C).
Each field corresponds to an element in the struct netconfig structure.
struct netconfig and the identifiers described on this manual page are
defined in <netconfig.h>. This structure includes the following mem‐
Network ID, including NULL terminator.
unsigned long nc_semantics
unsigned long nc_flag
Full pathname of the network device.
unsigned long nc_nlookups
Number of directory lookup libraries.
Names of the name-to-address translation
unsigned long nc_unused
Reserved for future expansion.
The nc_semantics field takes the following values, corresponding to the
semantics identified above:
The nc_flag field is a bitfield. The following bit, corresponding to
the attribute identified above, is currently recognized. NC_NOFLAG
indicates the absence of any attributes.
Example 1 A Sample netconfig File
Below is a sample netconfig file:
# The "Network Configuration" File.
# Each entry is of the form:
# <networkid> <semantics> <flags> <protofamily> <protoname> <device>
# The "-" in <nametoaddrlibs> 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 not be used for netdir_getbyname, netdir_getbyaddr,
# gethostbyname, gethostbyaddr, getservbyname, and getservbyport.
# There are no nametoaddr_libs for the inet family in Solaris anymore.
udp6 tpi_clts v inet6 udp /dev/udp6 -
tcp6 tpi_cots_ord v inet6 tcp /dev/tcp6 -
udp tpi_clts v inet udp /dev/udp -
tcp tpi_cots_ord v inet tcp /dev/tcp -
rawip tpi_raw - inet - /dev/rawip -
ticlts tpi_clts v loopback - /dev/ticlts straddr.so
ticotsord tpi_cots_ord v loopback - /dev/ticotsord straddr.so
ticots tpi_cots v loopback - /dev/ticots straddr.so
SEE ALSOdlopen(3C), getnetconfig(3NSL), getnetpath(3NSL), nsswitch.conf(4)
System Administration Guide: IP Services
Nov 18, 2003 NETCONFIG(4)