xref: /illumos-gate/usr/src/man/man5/networks.5 (revision b4fb003914e70b41d96dec8011864f6af1faf3ef)
te
Copyright 1989 AT&T
Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
NETWORKS 5 "March 30, 2022"
NAME
networks - network name database
SYNOPSIS
/etc/inet/networks

/etc/networks
DESCRIPTION
The networks file is a local source of information regarding the networks which comprise the Internet. The networks file can be used in conjunction with, or instead of, other networks sources, including the NIS maps networks.byname and networks.byaddr. Programs use the getnetbyname(3SOCKET) routines to access this information.

The network file has a single line for each network, with the following information:

official-network-name network-number aliases

Items are separated by any number of SPACE or TAB characters. A `#' indicates the beginning of a comment. Characters up to the end of the line are not interpreted by routines which search the file. This file is normally created from the official network database maintained at the Network Information Control Center (NIC), though local changes may be required to bring it up to date regarding unofficial aliases and/or unknown networks.

Network numbers may be specified in the conventional dot (`.') notation using the inet_network routine from the Internet address manipulation library, inet(3C). Network names may contain any printable character other than a field delimiter, NEWLINE, or comment character.

SEE ALSO
inet (3C), getnetbyaddr (3SOCKET), getnetbyname (3SOCKET), nsswitch.conf (5)
NOTES
The official SVR4 name of the networks file is /etc/inet/networks. The symbolic link /etc/networks exists for BSD compatibility.

The network number in networks database is the host address shifted to the right by the number of 0 bits in the address mask. For example, for the address 24.132.47.86 that has a mask of fffffe00, its network number is 803351. This is obtained when the address is shifted right by 9 bits. The address maps to 12.66.23. The trailing 0 bits should not be specified. The network number here is different from that described in netmasks(5). For this example, the entry in netmasks would be 24.132.46.0 fffffe00.