nconsole stands for ``newbie console''. With nconsole, you can control active nameserver process. You can change running mode of name server, adding or removing record, watching some status, setting temporary forwarder, and some more.
nconsole is a small program which connects your tty with UNIX domain socket. And usage is simple. Just type nconsole on your tty, it will be connected with nameserver immidiately. Otherwise, you may got ``file not found'' error. Then please check if newbie is running or not, and if pipe file for UNIX domain(usually /tmp/newbie.console) exists or not.
nconsole just print strings returned from newbie. Currently, it has 4-letter identifier on each head of line.
To use newbie interactively, just type ``newbie'' on your tty. It just connect your tty with nameserver, and you can type command to control newbie behaviour.
Please refer command list for each command.
[back to TOC]For single command, nconsole can be used on non-interactive mode. It just send given command to newbie. For example,
% nconsole flush
makes the caches flushed.
[back to TOC]Show brief command list without any arguments. With any [command name], it show better discription of the specified command.
Stops nameserver on the time. Current release supports ONLY `NOW' for [time] keyword. i.e. deferred shutdown is not yet implemented.
Restert nameserver immidiately. If restarting failed, server dumps log on the syslog output. If syslog output was not available (i.e. execv(2) failure), dying nameserver tries to put its last word on /etc/named.pid.
Close nconsole session.
Show various data. Without [kind] keyword, it shows the list of available keywords for [kind]. Current version has 4 keywords, slave(zone transfer record), iflist(list of active UDP interface), zonelist(list of active database), and version.
It change level of logging. I don't recommend you to try DEBUG because it produce too many output for debugging. Available loglevels are NONE(no log), ERR(fatal error), WARNING, NOTICE, INFO, and DEBUG.
It change running mode of name server. Running mode control the name server behaviour. There's three running modes in current release. [mode] could be one of regular, offline, and faith. For description of each runmode, refer ``What's the runmode?''
It swhiches the specified zone's dynamic option. It works like toggle switch. If freeze command is issued on dynamic zone, the zone turn into static, and vice versa. [zonename] is the origin of zone. You may check it with `show zonelist' command.
This command will lose effect if nameserver stopped. In other words, nameserver doesn't remember dynamic update status of each zone. It will be read from named.conf for every startup.
Flush all cached data. If you got some trouble, try this first.
This command select a zone for the target of `add' and `del' command. [zonename] is origin of target zone.
Add an record into target database. To select target, use `selectdb' command.
[domainname] is domainname the record belongs to.
[ttl] is time to live of the record in other nameserver's cache. It could be specified in seconds (`86400' = 86400secs. = 1 day), minutes (`1440M' = 1440mins. = 1 day), hours ('24H' = 24hours = 1 day), days ('7D' = 7 days = 1 week), weeks ('4W' = 4 weeks), or combination of those above ('4D3H2M1' = 4 days, 3 hours, 2 minutes, and one second = 356521 secs.).
You can use `+' directive as it indicate count down. If a character `+' is prepended on TTL, like `+60', it mean TTL must be counted down from 60 sec to zero. This feature will be useful if you use dynamic UPDATE with DHCP or some other dynamic configuration scheme.
Trick is really easy. If `+' sign is prepended on TTL, newbie understands this ttl as ttl + current time. And if you enable TTL_COUNTDOWN option in config.h, newbie ignores TTL larger than 10years. Then, it compares value in TTL field with current system clock, and deduct current time from the value. Of course, if it goes under zero, the value will be adjusted to zero. Time value corresponds year of 1998 is larger enough than 10 years, newbie understands TTL with `+' sign as TTL for countdown.
[rtype] is type of resource. Like A, AAAA, NS, TXT, MX.
[rdata] is resource data written in ascii.
add foo.newbie.sfc.wide.ad.jp. 1H A 192.168.0.1 add foo.newbie.sfc.wide.ad.jp. 1H HINFO CPU.is.unknown OS.is.unknown add foo.newbie.sfc.wide.ad.jp. 1W MX 10 shonan.sfc.wide.ad.jp. add foo.newbie.sfc.wide.ad.jp. 1D AAAA dead:beef:dead:beef::
In this example, it adds 4 records on foo.newbie.sfc.wide.ad.jp. These are A, HINFO, MX, and AAAA, in sequence.
This command deletes specified record. With full argument, the command will delete specified record. It mean the record with same domainname, saome resource type, saome resource data. If [rdata] omitted, it will delete ALL the records which have same domainname and resource type. If both of [rtype] and [rdata] omitted, it will delete ALL of the records belongs to the domainname.
THERE'S NO UNDO COMMAND. PLEASE THINK TWICE BEFORE YOU HIT ENTER KEY!
del foo.newbie.sfc.wide.ad.jp. A 192.168.0.2 del foo.newbie.sfc.wide.ad.jp. HINFO del bar.newbie.sfc.wide.ad.jp.
In these examples, it does delete several records. First line deletes an A record which have IPv4 address of 192.168.0.2. It doesn't delete other A records on foo.newbie.sfc.wide.ad.jp. Second line deletes all of HINFO record on foo.newbie.sfc.wide.ad.jp. And third line dlelets all records of bar.newbie.sfc.wide.ad.jp.
newbie checks the list of network interfaces periodically, in case of interface change like PCCard Ethernet on laptop computer or PPP link over modem line. If you want to update interface list immidiately, you may enter `nconsole ifcheck' manually. Also you may put it in `/etc/ppp/ppp.linkup' file or equiv.
This command change forwarding behaviour. Without [keyword], it will show available keyword and args set. There's 6 keywords on this command.
The keyword `on' and `off' doesn't take any [args] and switch the forwarding. If newbie got `forward off', it temporary stop using forwarder, and act as standalone nameserver. But forwarders list is preserved. And if newbie got `forward on', it resume to use specified forwarders.
The keyword 'add' takes two args, [ipaddr] and [availability]. It temporary add another forwarders other than ones specified in `newbie.boot' file.
The keyword 'del' takes one arg, [ipaddr]. It removes specified IP address from forwarders list.
`forward' command will lose effect if nameserver stopped. In other words, nameserver doesn't remember forwarders setting. It will be read from named.conf for every startup.
Assume we have 3 zones. newbie.test.local., localhost., 0.0.127.in-addr.arpa. To add host foo into newbie.test.local, which have IPv4 address of 10.0.1.2, please type as following.
% nconsole nconsole: interactive mode. WELC: newbie ver0.20 [date: Wed Apr 29 13:42:17 1998] [build: 104] PROT: 1 MESG: runmode = [regular] selectdb newbie.test.local. MESG: current DB is newbie.test.local. add foo.newbie.test.local. 1D A 10.0.1.2 MESG: update succeeded. close BYE nconsole: EOF received. %
The lines we have to type in are, `nconsole' / `selectdb newbie.test.local' / `add foo.newbie.test.local. 1D A 10.0.1.2' / `close'. All other lines are output from newbie.
You can modify several records in succession in same database. And you may add out-of-zone record as glue record.
% nconsole nconsole: interactive mode. WELC: newbie ver0.20 [date: Wed Apr 29 13:42:17 1998] [build: 104] PROT: 1 MESG: runmode = [regular] selectdb newbie.test.local. MESG: current DB is newbie.test.local. add foo.newbie.test.local. 1D HINFO Intel_486DX2/66 FreeBSD-2.1.5 MESG: update succeeded. del foo.newbie.test.local. A MESG: update succeeded. add foo.newbie.test.local. 1D AAAA aaaa:bbbb::1234:fedc MESG: update succeeded. add subd.newbie.test.local. 1D NS ns.subd.newbie.test.local. MESG: update succeeded. add ns.subd.newbie.test.local. 1D A 10.1.0.1 MESG: update succeeded. close BYE nconsole: EOF received. %
Got it?
[back to TOC]