DNS monitor project documentation tree

Program Design Document

User guide

DNSmon project overview

I want to write a DNS monitor program.  This program will contain a lot of my thinking about how applications ought to be written.  It will have:

Has anybody done anything like a DNS monitor before as an open source project?

I googoled "DNS monitor" and I found  a page on SiteScope which can do the DNS monitoringjabber alert and jabber monitor (an open source implementation of the jabber protocol),  intermapper, there is a DNS monitoring tool available at SimpleDNS.com.  So I don't find an open source DNS monitoring solution.  Since sitescope can do DNS monitoring, Real Networks will probably use that.  But I could still do it as an open source project and release it to the world.

Implementation of the DNS monitor: a road map

I assume that I am going to do the original version as a perl script.  My road map is:

Configuration file, monitoring capability, send E-mail when something goes wrong
A command line interface at startup which includes options for everything in the configuration file plus a daemon flag and a debug flag
readwrite state file
Sense when the nameservers disagree about a host
Logging via the syslog facility
A control/status port which uses TCP/IP
A command line contral/status interface, suitable for scripting
A status interface which uses VT100 graphics to display the state of the system
A browser interface
An X-windows interface
3.0 SNMP intrerface
rewrite in C


parse arguments
real configuration file and build host list and  ns list
bind to command/status tcp port   # version 2.0
change EUID/EGID                 
fork SNMP interface               # version 3.0
fork command/status handler       # version 2.0
foreach host in hostlist
   foreach ns in nslist[host]
     status = green
     set alarm
     start timer
     if host is dotted quad then
       ip_name = reverse_query (host, ns)
       ip_addr = query ( host, ns )
     if alarm timeout then status = red
     if time exceeds threshold then status = orange
     if answer is wrong then status = yellow   # version 1.2
     change state to reflect status            # version 1.1
     if status != green and state is green or
        status == green and state is not green then log using syslog   # version 1.3

The command/status port thread (version 2.0):

do forever
  listen on command/status port
  wait for connection
  fork a connection handler

connection handler