1.\" $NetBSD: networks.5,v 1.18 2020/01/20 13:08:40 nia Exp $ 2.\" 3.\" Copyright (c) 1983, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" @(#)networks.5 8.1 (Berkeley) 6/5/93 31.\" 32.Dd July 14, 2018 33.Dt NETWORKS 5 34.Os 35.Sh NAME 36.Nm networks 37.Nd Internet Protocol network name data base 38.Sh DESCRIPTION 39The 40.Nm 41file is used as a local source to translate between Internet Protocol 42.Pq Tn IP 43network addresses and network names (and vice versa). 44It can be used in conjunction with the DNS, 45.\"and the 46.\".Tn NIS 47.\"maps 48.\".Sq networks.byaddr , 49.\"and 50.\".Sq networks.byname , 51as controlled by 52.Xr nsswitch.conf 5 . 53.Pp 54While the 55.Nm 56file was originally intended to be an exhaustive list of all 57.Tn IP 58networks that the local host could communicate with, distribution 59and update of such a list for the world-wide 60.Tn Internet 61(or, indeed, for any large "enterprise" network) has proven to be 62prohibitive, so the Domain Name System 63.Pq Tn DNS 64is used instead, except as noted. 65.Pp 66For each 67.Tn IP 68network a single line should be present with the following information: 69.Dl name network [alias ...] 70.Pp 71These are: 72.Bl -tag -width network -offset indent -compact 73.It Em name 74Official network name 75.It Em network 76IP network number 77.It Em alias 78Network alias 79.El 80.Pp 81Items are separated by any number of blanks and/or tab characters. 82A 83.Dq \&# 84indicates the beginning of a comment; characters up to the end of 85the line are not interpreted by routines which search the file. 86.Pp 87Network number may be specified in the conventional dot 88.Pq Dq \&. 89notation using the 90.Xr inet_network 3 91routine 92from the 93.Tn IP 94address manipulation library, 95.Xr inet 3 . 96Network names may contain 97.Qq a 98through 99.Qq z , 100zero through nine, and dash. 101.Pp 102.Tn IP 103network numbers on the 104.Tn Internet 105are generally assigned to a site by its Internet Service Provider 106.Pq Tn ISP , 107who, in turn, get network address space assigned to them by one of 108the regional Internet Registries (e.g. ARIN, RIPE NCC, APNIC). 109These registries, in turn, answer to the Internet Assigned Numbers 110Authority 111.Pq Tn IANA . 112.Pp 113If a site changes its ISP from one to another, it will generally 114be required to change all its assigned IP addresses as part of the 115conversion; that is, return the previous network numbers to the previous 116.Tn ISP , 117and assign addresses to its hosts from 118.Tn IP 119network address space given by the new 120.Tn ISP . 121Thus, it is best for a savvy network manager to configure their 122hosts for easy renumbering, to preserve their ability to easily 123change their 124.Tn ISP 125should the need arise. 126.Sh FILES 127.Bl -tag -width /etc/networks -compact 128.It Pa /etc/networks 129The 130.Nm 131file resides in 132.Pa /etc . 133.El 134.Sh SEE ALSO 135.Xr getnetent 3 , 136.Xr nsswitch.conf 5 , 137.Xr resolv.conf 5 , 138.Xr hostname 7 , 139.Xr dhcpcd 8 , 140.Xr dhcpd 8 , 141.Xr named 8 142.Rs 143.%R RFC 2317 144.%D March 1998 145.%T "Classless IN-ADDR.ARPA delegation" 146.Re 147.Rs 148.%R RFC 1918 149.%D February 1996 150.%T "Address Allocation for Private Internets" 151.Re 152.Rs 153.%R RFC 1627 154.%D July 1994 155.%T "Network 10 Considered Harmful" 156.Re 157.Rs 158.%R RFC 1519 159.%D September 1993 160.%T "Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy" 161.Re 162.Rs 163.%R RFC 1101 164.%D April 1989 165.%T "DNS Encoding of Network Names and Other Types" 166.Re 167.Sh HISTORY 168The 169.Nm 170file format appeared in 171.Bx 4.2 . 172