Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

networks(5) [netbsd man page]

NETWORKS(5)						      BSD File Formats Manual						       NETWORKS(5)

NAME
networks -- Internet Protocol network name data base DESCRIPTION
The networks file is used as a local source to translate between Internet Protocol (IP) network addresses and network names (and vice versa). It can be used in conjunction with the DNS, as controlled by nsswitch.conf(5). While the networks file was originally intended to be an exhaustive list of all IP networks that the local host could communicate with, dis- tribution and update of such a list for the world-wide Internet (or, indeed, for any large "enterprise" network) has proven to be prohibi- tive, so the Domain Name System (DNS) is used instead, except as noted. For each IP network a single line should be present with the following information: name network [alias ...] These are: name Official network name network IP network number alias Network alias Items are separated by any number of blanks and/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. Network number may be specified in the conventional dot (``.'') notation using the inet_network(3) routine from the IP address manipulation library, inet(3). Network names may contain "a" through "z", zero through nine, and dash. IP network numbers on the Internet are generally assigned to a site by its Internet Service Provider (ISP), who, in turn, get network address space assigned to them by one of the regional Internet Registries (e.g. ARIN, RIPE NCC, APNIC). These registries, in turn, answer to the Internet Assigned Numbers Authority (IANA). If a site changes its ISP from one to another, it will generally be required to change all its assigned IP addresses as part of the conver- sion; that is, return the previous network numbers to the previous ISP, and assign addresses to its hosts from IP network address space given by the new ISP. Thus, it is best for a savvy network manager to configure his hosts for easy renumbering, to preserve his ability to easily change his ISP should the need arise. FILES
/etc/networks The networks file resides in /etc. SEE ALSO
getnetent(3), nsswitch.conf(5), resolv.conf(5), hostname(7), dhclient(8), dhcpd(8), named(8) Classless IN-ADDR.ARPA delegation, RFC 2317, March 1998. Address Allocation for Private Internets, RFC 1918, February 1996. Network 10 Considered Harmful, RFC 1627, July 1994. Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy, RFC 1519, September 1993. DNS Encoding of Network Names and Other Types, RFC 1101, April 1989. HISTORY
The networks file format appeared in 4.2BSD. BSD
November 17, 2000 BSD

Check Out this Related Man Page

GETNETENT(3)						   BSD Library Functions Manual 					      GETNETENT(3)

NAME
getnetent, getnetbyaddr, getnetbyname, setnetent, endnetent -- get network entry LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <netdb.h> struct netent * getnetent(void); struct netent * getnetbyname(const char *name); struct netent * getnetbyaddr(uint32_t net, int type); void setnetent(int stayopen); void endnetent(void); DESCRIPTION
The getnetent(), getnetbyname(), and getnetbyaddr() functions each return a pointer to an object with the following structure describing an internet network. This structure contains either the information obtained from the nameserver, named(8), broken-out fields of a line in the network data base /etc/networks, or entries supplied by the yp(8) system. The order of the lookups is controlled by the `networks' entry in nsswitch.conf(5). struct netent { char *n_name; /* official name of net */ char **n_aliases; /* alias list */ int n_addrtype; /* net number type */ uint32_t n_net; /* net number */ }; The members of this structure are: n_name The official name of the network. n_aliases A zero terminated list of alternate names for the network. n_addrtype The type of the network number returned; currently only AF_INET. n_net The network number. Network numbers are returned in machine byte order. The getnetent() function reads the next line of the file, opening the file if necessary. The setnetent() function opens and rewinds the file. If the stayopen flag is non-zero, the net data base will not be closed after each call to getnetbyname() or getnetbyaddr(). The endnetent() function closes the file. The getnetbyname() function and getnetbyaddr() sequentially search from the beginning of the file until a matching net name or net address and type is found, or until EOF is encountered. The type argument must be AF_INET. Network numbers are supplied in host order. FILES
/etc/networks /etc/nsswitch.conf /etc/resolv.conf DIAGNOSTICS
Null pointer returned on EOF or error. SEE ALSO
networks(5) RFC 1101 HISTORY
The getnetent(), getnetbyaddr(), getnetbyname(), setnetent(), and endnetent() functions appeared in 4.2BSD. BUGS
The data space used by these functions is thread-specific; if future use requires the data, it should be copied before any subsequent calls to these functions overwrite it. Only Internet network numbers are currently understood. Expecting network numbers to fit in no more than 32 bits is probably naive. BSD
June 4, 1993 BSD
Man Page