NDB(7)
π NAME π
okay bestie, welcome to NDB(7) β the manual page for ndb, aka the Network database, straight from the Miscellaneous Information Manual. This is literally the whole lore of how the network database files are put together. π«Ά
β¨ DESCRIPTION β¨
The network database is made of files that describe machines known to the local installation and machines known publicly. The files are built from multi-line tuples made up of attribute/value pairs of the form attr=value, or sometimes just attr. Each line that starts without white space starts a new tuple, and lines starting with # are comments. periodt.
Within tuples, pairs on the same line bind tighter than pairs on different lines. iykyk.
The file /lib/ndb/local is the root of the database. Other files are included in the database if a tuple with an attribute-value pair of attribute database and no value exists in /lib/ndb/local. Within the database tuple, each pair with attribute file identifies a file to be included in the database. The files are searched in the order they appear. For example:
database=
file=/lib/ndb/common
file=/lib/ndb/local
file=/lib/ndb/global
That declares the database to be composed of the three files /lib/ndb/common, /lib/ndb/local, and /lib/ndb/global. By default, /lib/ndb/local is searched before the others. However, /lib/ndb/local may be included in the database to redefine its ordering.
Programs search the database directly using the routines in ndb(3). The routine ndbipinfo imposes structure on the otherwise flat database by using knowledge specific to the network. The internet is made up of networks which can be subnetted multiple times. A network must have an ipnet attribute and is uniquely identified by the values of its ip and ipmask attributes. If the ipmask is missing, the relevant Class A, B or C one is used.
A search for an attribute associated with a network or host starts at the lowest level, the entry for the host or network itself, and works its way up, bit by bit, looking at entries for nets/subnets that include the network or host. The search ends when the attribute is found. For example, consider these entries:
ipnet=murray-hill ip=135.104.0.0 ipmask=255.255.0.0
dns=135.104.10.1
ntp=ntp.cs.bell-labs.com
ipnet=plan9 ip=135.104.9.0 ipmask=255.255.255.0
ntp=oncore.cs.bell-labs.com
smtp=smtp1.cs.bell-labs.com
ip=135.104.9.6 sys=anna dom=anna.cs.bell-labs.com
smtp=smtp2.cs.bell-labs.com
Here anna is on the subnet plan9 which is in turn on the class B net murray-hill. Assume that weβre searching for annaβs NTP and SMTP servers. The search starts by looking for an entry with sys=anna. We find the anna entry. Since it has an smtp=smtp2.cs.bell-labs.com pair, weβre done looking for that attribute. To fulfill the NTP request, we continue by looking for networks that include annaβs IP address. We lop off the right most one bit from annaβs address and look for an ipnet= entry with ip=135.104.9.4. Not finding one, we drop another bit and look for an ipnet= entry with ip=135.104.9.0. There is such an entry and it has the pair, ntp=oncore.cs.bell-labs.com, ending our search.
A number of attributes are meaningful to programs and thus reserved. They are:
sysβ system name. main character identity.domβ Internet domain name.ipβ Internet address.etherβ Ethernet address.bootfβ file to download for initial bootstrap.ipnetβ Internet network name.ipmaskβ Internet network mask.ipgwβ Internet gateway.authβ authentication server to be used.authdomβ authentication domain. Plan 9 supports multiple authentication domains. To specify an authentication server for a particular domain, add a tuple containing bothauthandauthdomattributes and values. so specific, love that.fsβ file server to be used.tcpβ a TCP service name.udpβ a UDP service name.ilβ an IL service name.portβ a TCP, UDP, or IL port number.restrictedβ a TCP service that can be called only by ports numbered less that1024. gatekept by port numbers, fr fr.protoβ a protocol supported by a host.dnsdomainβ a domain name thatndb/dnsadds onto any unrooted names when doing a search. There may be multiplednsdomainpairs.dnsβ a DNS server to use (for DNS and DHCP).ntpβ an NTP server to use (for DHCP).smtpβ an SMTP server to use (for DHCP).timeβ a time server to use (for DHCP).winsβ a Windows name server (for DHCP).mxβ mail exchanger (for DNS and DHCP).soaβ start of area (for DNS).
π EXAMPLES π
A tuple for the CPU server, spindle.
sys = spindle
dom=spindle.research.bell-labs.com
bootf=/mips/9powerboot
ip=135.104.117.32 ether=080069020677
proto=il
Entries for the network mh-astro-net and its subnets.
ipnet=mh-astro-net ip=135.104.0.0 ipmask=255.255.255.0
fs=bootes.research.bell-labs.com
ipgw=r70.research.bell-labs.com
auth=p9auth.research.bell-labs.com
ipnet=unix-room ip=135.104.117.0
ipgw=135.104.117.1
ipnet=third-floor ip=135.104.51.0
ipgw=135.104.51.1
Mappings between TCP service names and port numbers.
tcp=sysmon port=401
tcp=rexec port=512 restricted
tcp=9fs port=564
π FILES π
/ndb/localβ first database file searched. the first stop on the database tour.
π SEE ALSO π
mwah π β thatβs the whole NDB(7) page, bestie. It comes from the Miscellaneous Information Manual, the footer is just NDB(7), and thereβs no date stamped on it, so thatβs the iconic original energy. π«Ά
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms