plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

ndb.1 (10500B)


      1 .TH NDB 1
      2 .SH NAME
      3 ndbquery, ndbmkhash, ndbmkdb, ndbipquery, ndbmkhosts \- network database
      4 .SH SYNOPSIS
      5 .B ndbquery
      6 [
      7 .B -f
      8 .I dbfile
      9 ]
     10 .I "attr value"
     11 [
     12 .I rattr
     13 ]
     14 .br
     15 .B ndbipquery
     16 .I "attr value"
     17 .I rattr...
     18 .br
     19 .B ndbmkhash
     20 .I "file attr"
     21 .br
     22 .B ndbmkdb
     23 .SH DESCRIPTION
     24 The network database holds administrative information used by
     25 .I authdial
     26 (see
     27 .MR authsrv (3) )
     28 and
     29 .MR secstored (1) .
     30 .PP
     31 .I Ndbquery 
     32 searches the database for an attribute of type
     33 .I attr
     34 and value
     35 .IR value .
     36 If
     37 .I rattr
     38 is not specified, all entries matched by the search are returned.
     39 If 
     40 .I rattr
     41 is specified, the value of the first pair with attribute
     42 .I rattr
     43 of all the matched entries is returned.
     44 .PP
     45 .I Ndbipquery
     46 uses
     47 .I ndbipinfo
     48 (see
     49 .MR ndb (3) )
     50 to search for the values of the attributes
     51 .I rattr
     52 corresponding to the system
     53 with entries of attribute type
     54 .I attr
     55 and
     56 value
     57 .IR value .
     58 .PP
     59 .I Ndbmkhash
     60 creates a hash file for all entries with attribute
     61 .I attr
     62 in database file
     63 .IR file .
     64 The hash files are used by 
     65 .I ndbquery
     66 and by the ndb library routines.
     67 .\" .PP
     68 .\" .I Ndb/cs
     69 .\" is a server used by
     70 .\" .IR dial (2)
     71 .\" to translate network names.
     72 .\" It is started at boot time.
     73 .\" It finds out what networks are configured
     74 .\" by looking for
     75 .\" .B /net/*/clone
     76 .\" when it starts.
     77 .\" It can also be told about networks by writing
     78 .\" to
     79 .\" .B /net/cs
     80 .\" a message of the form:
     81 .\" .IP
     82 .\" .B "add net1 net2 ..."
     83 .\" .PP
     84 .\" .I Ndb/cs
     85 .\" also sets the system name in
     86 .\" .B /dev/sysname
     87 .\" if it can figure it out.
     88 .\" The options are:
     89 .\" .TP
     90 .\" .B -f
     91 .\" supplies the name of the data base file to use,
     92 .\" default
     93 .\" .BR /lib/ndb/local .
     94 .\" .TP
     95 .\" .B -x
     96 .\" specifies the mount point of the
     97 .\" network.
     98 .\" .TP
     99 .\" .B -n
    100 .\" causes cs to do nothing but set the system name.
    101 .\" .PP
    102 .\" .I Ndb/csquery
    103 .\" can be used to query
    104 .\" .I ndb/cs
    105 .\" to see how it resolves addresses.
    106 .\" .I Ndb/csquery
    107 .\" prompts for addresses and prints out what
    108 .\" .I ndb/cs
    109 .\" returns.
    110 .\" .I Server
    111 .\" defaults to
    112 .\" .BR /net/cs .
    113 .\" If any
    114 .\" .I addrs
    115 .\" are specified,
    116 .\" .I ndb/csquery
    117 .\" prints their translations and immediately exits.
    118 .\" The exit status will be nil only if all addresses 
    119 .\" were successfully translated
    120 .\" The
    121 .\" .B -s
    122 .\" flag sets exit status without printing any results.
    123 .\" .PP
    124 .\" .I Ndb/dns
    125 .\" is a server used by
    126 .\" .I ndb/cs
    127 .\" and by remote systems to translate Internet domain names.
    128 .\" .I Ndb/dns
    129 .\" is started at boot time.
    130 .\" By default
    131 .\" .I dns
    132 .\" serves only requests written to
    133 .\" .BR /net/dns .
    134 .\" The options are:
    135 .\" .TP
    136 .\" .B -f
    137 .\" supplies the name of the data base file to use,
    138 .\" default
    139 .\" .BR /lib/ndb/local .
    140 .\" .TP
    141 .\" .B -x
    142 .\" specifies the mount point of the
    143 .\" network.
    144 .\" .TP
    145 .\" .B -s
    146 .\" also answer domain requests sent to UDP port 53.
    147 .\" .TP
    148 .\" .B -n
    149 .\" whenever a zone that we serve changes, send UDP NOTIFY
    150 .\" messages to any dns slaves for that zone.
    151 .\" .TP
    152 .\" .B -z
    153 .\" whenever we receive a UDP NOTIFY message, run
    154 .\" .I program
    155 .\" with the domain name of the area as its argument.
    156 .\" .TP
    157 .\" .B -r
    158 .\" defer to other servers to resolve queries.
    159 .\" .PP
    160 .\" When the
    161 .\" .B -r
    162 .\" option is specified, the servers used come from the
    163 .\" .I dns
    164 .\" attribute in the database.  For example, to specify a set of dns servers that
    165 .\" will resolve requests for systems on the network
    166 .\" .IR mh-net :
    167 .\" .EX
    168 .\" 
    169 .\" ipnet=mh-net ip=135.104.0.0 ipmask=255.255.0.0
    170 .\" 	dns=ns1.cs.bell-labs.com
    171 .\" 	dns=ns2.cs.bell-labs.com
    172 .\" dom=ns1.cs.bell-labs.com ip=135.104.1.11
    173 .\" dom=ns2.cs.bell-labs.com ip=135.104.1.12
    174 .\" 
    175 .\" .EE
    176 .\" .PP
    177 .\" The server for a domain is indicated by a database entry containing
    178 .\" both a
    179 .\" .I dom
    180 .\" and a
    181 .\" .I ns
    182 .\" attribute.
    183 .\" For example, the entry for the Internet root is:
    184 .\" .EX
    185 .\" 
    186 .\" dom=
    187 .\" 	ns=A.ROOT-SERVERS.NET
    188 .\" 	ns=B.ROOT-SERVERS.NET
    189 .\" 	ns=C.ROOT-SERVERS.NET
    190 .\" dom=A.ROOT-SERVERS.NET ip=198.41.0.4
    191 .\" dom=B.ROOT-SERVERS.NET ip=128.9.0.107
    192 .\" dom=C.ROOT-SERVERS.NET ip=192.33.4.12
    193 .\" 
    194 .\" .EE
    195 .\" The last three lines provide a mapping for the
    196 .\" server names to their ip addresses.  This is only
    197 .\" a hint and will be superseded from whatever is learned
    198 .\" from servers owning the domain.
    199 .\" .PP
    200 .\" You can also serve a subtree of the domain name space from the local
    201 .\" database.  You indicate subtrees that you'ld like to serve by
    202 .\" adding an
    203 .\" .B soa=
    204 .\" attribute to the root entry.
    205 .\" For example, the Bell Labs CS research domain is:
    206 .\" .EX
    207 .\" 
    208 .\" dom=cs.bell-labs.com soa=
    209 .\" 	refresh=3600 ttl=3600
    210 .\" 	ns=plan9.bell-labs.com
    211 .\" 	ns=ns1.cs.bell-labs.com
    212 .\" 	ns=ns2.cs.bell-labs.com
    213 .\" 	mb=presotto@plan9.bell-labs.com
    214 .\" 	mx=mail.research.bell-labs.com pref=20
    215 .\" 	mx=plan9.bell-labs.com pref=10
    216 .\" 	dnsslave=nslocum.cs.bell-labs.com
    217 .\" 	dnsslave=vex.cs.bell-labs.com
    218 .\" 
    219 .\" .EE
    220 .\" Here, the
    221 .\" .B mb
    222 .\" entry is the mail address of the person responsible for the
    223 .\" domain (default
    224 .\" .BR postmaster ).
    225 .\" The
    226 .\" .B mx
    227 .\" entries list mail exchangers for the domain name and
    228 .\" .B refresh
    229 .\" and
    230 .\" .B ttl
    231 .\" define the area refresh interval and the minimum TTL for
    232 .\" records in this domain.
    233 .\" The
    234 .\" .B dnsslave
    235 .\" entries specify slave DNS servers that should be notified
    236 .\" when the domain changes.  The notification also requires
    237 .\" the
    238 .\" .B -n
    239 .\" flag.
    240 .\" .PP
    241 .\" You can also serve reverse lookups (returning the name that
    242 .\" goes with an IP address) by adding an
    243 .\" .B soa=
    244 .\" attribute to the entry defining the root of the reverse space.
    245 .\" For example, to provide reverse lookup for all addresses in
    246 .\" starting with 135.104 you must have a record like:
    247 .\" .EX
    248 .\" 
    249 .\" dom=104.135.in-addr.arpa soa=
    250 .\" 	refresh=3600 ttl=3600
    251 .\" 	ns=plan9.bell-labs.com
    252 .\" 	ns=ns1.cs.bell-labs.com
    253 .\" 	ns=ns2.cs.bell-labs.com
    254 .\" .EE
    255 .\" Notice the form of the reverse address, i.e., it's the bytes of the
    256 .\" address range you are serving reversed and with
    257 .\" .B .in-addr.arpa
    258 .\" appended.  This is a standard form for a domain name in an IPv4 PTR record.
    259 .\" .PP
    260 .\" If such an entry exists in the database, reverse addresses will
    261 .\" automaticly be generated from any IP addresses in the database
    262 .\" that are under this root.  For example
    263 .\" .EX
    264 .\" 
    265 .\" dom=ns1.cs.bell-labs.com ip=135.104.1.11
    266 .\" .EE
    267 .\" will automaticly create both forward and reverse entries for
    268 .\" .B ns1.cs.bell-labs.com .
    269 .\" Unlike other DNS servers, there's no way to generate
    270 .\" inconsistent forward and reverse entries.
    271 .\" .PP
    272 .\" Delegation of a further subtree to another set of name servers
    273 .\" is indicated by an
    274 .\" .B soa=delegated
    275 .\" attribute.
    276 .\" .EX
    277 .\" 
    278 .\" dom=bignose.cs.research.bell-labs.com
    279 .\" 	soa=delegated
    280 .\" 	ns=anna.cs.research.bell-labs.com
    281 .\" 	ns=dj.cs.research.bell-labs.com
    282 .\" 
    283 .\" .EE
    284 .\" Nameservers within the delegated domain (as in this example)
    285 .\" must have their IP addresses listed elsewhere in
    286 .\" .I ndb
    287 .\" files.
    288 .\" .PP
    289 .\" Wild-carded domain names can also be used.
    290 .\" For example, to specify a mail forwarder for all Bell Labs research systems:
    291 .\" .EX
    292 .\" 
    293 .\" dom=*.research.bell-labs.com
    294 .\" 	mx=research.bell-labs.com
    295 .\" 
    296 .\" .EE
    297 .\" `Cname' aliases may be established by adding a
    298 .\" .B cname
    299 .\" attribute giving the real domain name;
    300 .\" the name attached to the
    301 .\" .B dom
    302 .\" attribute is the alias.
    303 .\" `Cname' aliases are severely restricted;
    304 .\" the aliases may have no other attributes than
    305 .\" .B dom
    306 .\" and are daily further restricted in their use by new RFCs.
    307 .\" .EX
    308 .\" 
    309 .\" cname=anna.cs.research.bell-labs.com dom=www.cs.research.bell-labs.com
    310 .\" 
    311 .\" .EE
    312 .\" .I Ndb/dnsquery
    313 .\" can be used to query
    314 .\" .I ndb/dns
    315 .\" to see how it resolves requests.
    316 .\" .I Ndb/dnsquery
    317 .\" prompts for commands of the form
    318 .\" .IP
    319 .\" .I "domain-name request-type"
    320 .\" .LP
    321 .\" where
    322 .\" .I request-type
    323 .\" can be
    324 .\" .BR ip ,
    325 .\" .BR mx ,
    326 .\" .BR ns ,
    327 .\" .BR cname ,
    328 .\" .BR ptr ....
    329 .\" In the case of the inverse query type,
    330 .\" .BR ptr ,
    331 .\" .I dnsquery
    332 .\" will reverse the ip address and tack on the
    333 .\" .B .in-addr.arpa
    334 .\" for you.
    335 .\" .PP
    336 .\" .I Ndb/dnsdebug
    337 .\" is like
    338 .\" .I ndb/dnsquery
    339 .\" but bypasses the local server.
    340 .\" It communicates via UDP with the domain name servers
    341 .\" in the same way that the local resolver would and displays
    342 .\" all packets received.
    343 .\" The query can be specified on the command line or
    344 .\" can be prompted for.
    345 .\" The queries look like those of
    346 .\" .I ndb/dnsquery
    347 .\" with one addition.
    348 .\" .I Ndb/dnsdebug
    349 .\" can be directed to query a particular name server by
    350 .\" the command
    351 .\" .BI @ name-server\f1.
    352 .\" From that point on, all queries go to that name server
    353 .\" rather than being resolved by
    354 .\" .IR dnsdebug .
    355 .\" The
    356 .\" .B @
    357 .\" command returns query resolution to
    358 .\" .IR dnsdebug .
    359 .\" Finally, any command preceded by a
    360 .\" .BI @ name-server
    361 .\" sets the name server only for that command.
    362 .\" .PP
    363 .\" Normally
    364 .\" .I dnsdebug
    365 .\" uses the
    366 .\" .B /net
    367 .\" interface and the database file
    368 .\" .BR /lib/ndb/local.
    369 .\" The
    370 .\" .B -x
    371 .\" option directs
    372 .\" .I dnsdebug
    373 .\" to use the
    374 .\" .B /net.alt
    375 .\" interface and
    376 .\" .B /lib/ndb/external
    377 .\" file.
    378 .\" The
    379 .\" .B -r
    380 .\" option is the same as for
    381 .\" .IR ndb/dns .
    382 .PP
    383 .I Ndbmkdb
    384 is used in concert with
    385 .MR awk (1)
    386 scripts to convert
    387 uucp systems files and IP host files
    388 into database files.
    389 It is very specific to the situation at Murray Hill.
    390 .PP
    391 When the database files change underfoot,
    392 running programs
    393 track them properly.  Nonetheless, to keep the database searches efficient
    394 it is necessary to run
    395 .I ndbmkhash
    396 whenever the files are modified.
    397 It may be profitable to control this by a frequent
    398 .MR cron (8)
    399 job.
    400 .PP
    401 .I Ndbmkhosts
    402 generates a BSD style 
    403 .BR hosts ,
    404 .BR hosts.txt ,
    405 and
    406 .B hosts.equiv
    407 files from ndb data base files specified on the
    408 command line (default
    409 .B \*9/ndb/local
    410 and
    411 .BR \*9/ndb/friends ).
    412 It only processes hosts whose domain names end in
    413 .IR domname .
    414 The output files are named
    415 .BI db. domname \fR,
    416 .BI equiv. domname \fR,
    417 and
    418 .BI txt. domname \fR.
    419 For historical reasons, the default
    420 .I domname
    421 is
    422 .BR research.att.com.
    423 .SH EXAMPLE
    424 .IP
    425 .EX
    426 % ndbquery sys helix
    427 sys=helix dom=helix.research.bell-labs.com bootf=/mips/9powerboot
    428 	ip=135.104.117.31 ether=080069020427
    429 	proto=il 
    430 .EE
    431 .SH FILES
    432 .TP
    433 .B \*9/ndb/local
    434 first database file searched
    435 .TP
    436 .B \*9/ndb/local.*
    437 hash files for
    438 .B \*9/ndb/local
    439 .SH SOURCE
    440 .B \*9/src/cmd/ndb
    441 .SH SEE ALSO
    442 .MR ndb (3) ,
    443 .MR ndb (7)