'\" te .\" Copyright 1989 AT&T .\" Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved .TH networks 4 "17 Jan 2002" "SunOS 5.11" "File Formats" .SH NAME networks \- network name database .SH SYNOPSIS .LP .nf \fB/etc/inet/networks\fR .fi .LP .nf \fB/etc/networks\fR .fi .SH DESCRIPTION .sp .LP The \fBnetworks\fR 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 \fBnetworks.byname\fR and \fBnetworks.byaddr\fR and the NIS+ table \fBnetworks\fR. Programs use the \fBgetnetbyname\fR(3SOCKET) routines to access this information. .sp .LP The network file has a single line for each network, with the following information: .sp .in +2 .nf \fIofficial-network-name network-number aliases\fR .fi .in -2 .sp .LP Items are separated by any number of \fBSPACE\fR or \fBTAB\fR characters. A `\fB#\fR' 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. .sp .LP Network numbers may be specified in the conventional dot (`\fB\&.\fR') notation using the \fBinet_network\fR routine from the Internet address manipulation library, \fBinet\fR(7P). Network names may contain any printable character other than a field delimiter, \fBNEWLINE\fR, or comment character. .SH SEE ALSO .sp .LP \fBgetnetbyaddr\fR(3SOCKET), \fBgetnetbyname\fR(3SOCKET), \fBinet\fR(3SOCKET), \fBnsswitch.conf\fR(4), \fBinet\fR(7P) .SH NOTES .sp .LP The official SVR4 name of the \fBnetworks\fR file is \fB/etc/inet/networks\fR. The symbolic link \fB/etc/networks\fR exists for \fBBSD\fR compatibility. .sp .LP The network number in \fBnetworks\fR database is the host address shifted to the right by the number of 0 bits in the address mask. For example, for the address \fB24.132.47.86\fR that has a mask of \fBfffffe00\fR, its network number is \fB803351\fR. This is obtained when the address is shifted right by 9 bits. The address maps to \fB12.66.23\fR. The trailing 0 bits should not be specified. The network number here is different from that described in \fBnetmasks\fR(4). For this example, the entry in \fBnetmasks\fR would be \fB24.132.46.0 fffffe00\fR.