9srv Manual Collection/plan9/ndb(8) | 9srv Manual Collection/plan9/ndb(8) |
---|
Ndb/query searches the database dbfile (/lib/ndb/local by default) for an attribute of type attr and value value. If rattr is not specified, all entries matched by the search are printed. If rattr is specified, the value of the first pair with attribute rattr of all the matched entries normally is printed. Under -m and rattr, the values of all pairs with a rattr attribute within the first matching entry are printed. Under -a and rattr, all values of pairs with a rattr attribute within all entries are printed.
Ndb/ipquery uses ndbipinfo (see ndb(2)) to search for the values of the attributes rattr corresponding to the system with entries of attribute type attr and value value.
Ndb/inform sends an RFC2136 DNS inform packet to a nameserver to associate the host's IPv4 address with its DNS name. This is required if the domain's nameserver is a Microsoft Windows Active Directory controller. The host's domain name will be sent to the AD controller unless a tuple of the form inform=xxx is found in the host's ndb entry.
Ndb/mkdb is used in concert with awk(1) scripts to convert uucp systems files and IP host files into database files. It is very specific to the situation at Murray Hill.
When the database files change underfoot, ndb/cs and ndb/dns track them properly. Nonetheless, to keep the database searches efficient it is necessary to run ndb/mkhash whenever the files are modified. It may be profitable to control this by a frequent cron(8) job.
Ndb/mkhosts generates a BSD style hosts, hosts.txt, and hosts.equiv files from an ndb data base file specified on the command line (default /lib/ndb/local). For local reasons the files are called hosts.1127, astro.txt, and hosts.equiv.
Ndb/cs also sets the system name in /dev/sysname if it can figure it out. The options are:
Ndb/csquery
queries
ndb/cs
to see how it resolves addresses.
Ndb/csquery
prompts for addresses and prints what
ndb/cs
returns.
Server
defaults to
/net/cs.
If any
addrs
are specified,
ndb/csquery
prints their translations and immediately exits.
The exit status will be nil only if all addresses
were successfully translated.
The
-s
flag sets exit status without printing any results.
When the -r option is specified, the servers used come from the dns attribute in the database. For example, to specify a set of dns servers that will resolve requests for systems on the network mh-net:
The server for a domain is indicated by a database entry containing both a dom and a ns attribute.
The last three lines provide a mapping for the server names to their ip addresses. This is only a hint and will be superseded from whatever is learned from servers owning the domain.
Here, the mb entry is the mail address of the person responsible for the domain (default postmaster). The mx entries list mail exchangers for the domain name and refresh and ttl define the area refresh interval and the minimum TTL for records in this domain. The dnsslave entries specify slave DNS servers that should be notified when the domain changes. The notification also requires the -n flag.
For example, to provide reverse lookup for all addresses in starting with 135.104 or fd00::, ndb must contain a record like:
Notice the form of the reverse address. For IPv4, it's the bytes of the address range you are serving reversed and expressed in decimal, and with .in-addr.arpa appended. For IPv6, it's the nibbles (4-bit fields) of the address range you are serving reversed and expressed in hexadecimal, and with .ip6.arpa appended. These are the standard forms for a domain name in a PTR record.
If such an soa entry exists in the database, reverse addresses will automatically be generated from any IP addresses in the database that are under this root. For example
will automatically create both forward and reverse entries for ns1.cs.bell-labs.com. Unlike other DNS servers, there's no way to generate inconsistent forward and reverse entries.
For example, this is how to serve RFC-2317 ptr records for the subnet 65.14.39.128/123.
Nameservers within the delegated domain (as in this example) must have their IP addresses listed elsewhere in ndb files.
`Cname' aliases may be established by adding a cname attribute giving the real domain name; the name attached to the dom attribute is the alias. `Cname' aliases are severely restricted; the aliases may have no other attributes than dom and are daily further restricted in their use by new RFCs.
makes www.... a synonym for the canonical name anna.....
In such a situation, running dns -so on a machine that imports access to the outside network via /net.alt from a machine that straddles the firewalls, or that straddles the firewalls itself, will let internal machines query such a machine and receive answers from outside nameservers for outside addresses and inside nameservers for inside addresses, giving the appearance of a unified domain name space, while bypassing the corporate DNS proxies or firewalls. This is different from running dns -s and dns -sRx /net.alt -f /lib/ndb/external on the same machine, which keeps the inside and outside namespaces entirely separate.
Under -o, several sys names are significant: inside-dom, inside-ns, and outside-ns. Inside-dom should contain a series of dom pairs naming domains internal to the organization. Inside-ns should contain a series of ip pairs naming the internal DNS `root' servers. Outside-ns should contain a series of ip pairs naming the external DNS servers to consult.
where request-type can be ip, ipv6, mx, ns, cname, ptr.... In the case of the inverse query type, ptr, dnsquery will reverse the ip address and tack on the .in-addr.arpa if necessary.
Ndb/dnsdebug is like ndb/dnsquery but bypasses the local server. It communicates via UDP (and sometimes TCP) with the domain name servers in the same way that the local resolver would and displays all packets received. The query can be specified on the command line or can be prompted for. The queries look like those of ndb/dnsquery with one addition. Ndb/dnsdebug can be directed to query a particular name server by the command @name-server. From that point on, all queries go to that name server rather than being resolved by dnsdebug. The @ command returns query resolution to dnsdebug. Finally, any command preceded by a @name-server sets the name server only for that command.
Normally dnsdebug uses the /net interface and the database file /lib/ndb/local. The -f option supplies the name of the data base file to use. The -r option is the same as for ndb/dns. The -x option directs dnsdebug to use the /net.alt interface and /lib/ndb/external database file.
Look up plan9.bell-labs.com and its IP address in the DNS.
Print the names of all PCs that boot via PXE.
9srv Manual Collection/plan9/ndb(8) | Rev: Fri Dec 06 01:57:27 GMT 2013 |