home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7508 < prev    next >
Encoding:
Text File  |  1992-12-18  |  5.2 KB  |  133 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!uvaarpa!mmdf
  3. From: Alan Stebbens <aks%anywhere@hub.ucsb.edu>
  4. Subject: Re: More on DNS stuff 
  5. Message-ID: <1992Dec18.003834.29951@uvaarpa.Virginia.EDU>
  6. Sender: mmdf@uvaarpa.Virginia.EDU (Mail System)
  7. Reply-To: aks%anywhere@hub.ucsb.edu
  8. Organization: The Internet
  9. Date: Fri, 18 Dec 1992 00:38:34 GMT
  10. Lines: 121
  11.  
  12. Sorry it's been so long since I announced it, but here's the info on the
  13. Perl scripts to maintain a host and subdomain database for a 2nd-level
  14. DNS domain (like "ucsb.edu"), with possibly delegated 3rd-level
  15. subdomains (like "dept.ucsb.edu").
  16.  
  17. I am announcing these for the benefit of some people who have asked for
  18. them, but they are provided completely without any warranty or promise
  19. of support.  They were written over a period of four years, with gradual
  20. improvements and complete rewrites.  Some amount of history is visible
  21. through RCS files.
  22.  
  23. There are two tar files to look at, with anonymous FTP to hub.ucsb.edu:
  24. DNSHosts.tar.Z and named.conf.tar.Z.
  25.  
  26. DNSHosts.tar.Z    - this directory contains our scripts and files which
  27.     construct a complete set of DNS files for the "ucsb.edu" domain,
  28.     including other ancillary files, like /etc/hosts, /etc/networks,
  29.     etc, from a master Jinx database, and some associated library
  30.     files.
  31.  
  32. These scripts accept a master host database, managed through Jinx,
  33. and generate a configurable set of files.  The table is defined in
  34. lib/header.pl, and it is very simple to add new files.  All of the DNS
  35. files are constructed by "modules", each of which is a very small Perl
  36. script which extracts the relevant piece of info from the database and
  37. writes to a standard filehandle in the format expected for the kind of
  38. file being constructed.
  39.  
  40. It is very easy to add new files to be generated during a "make".  For
  41. example, one of the the things we recently decided to do was have our
  42. host database define host "categories", and to generate a file which,
  43. for each host on a separate line, listed its associated categories.
  44. This file is used by other scripts to perform routine system tasks by
  45. host category.  Here's the module which creates the category file
  46. (comments omitted) (we called the categories: "system groups"):
  47.  
  48.     file: MakeSysGroups
  49.     ==================
  50.     #/eci/bin/perl
  51.     require '/eci/etc/hosts/lib/header.pl';
  52.     require "$BIN/MakeUtil.pl";
  53.     
  54.     sub SysgroupMethod {
  55.     local(@groups) = sort split(' ',$rec[$Fields{'GroupList'}]);
  56.     local($grouplist) = join(' ',@groups);
  57.     printf "%-20s%s\n",$name,$grouplist;
  58.     $Lines++;
  59.     }
  60.     &MakeFileWithIfNames($SYSGROUP,'','SysgroupMethod','');
  61.     ====================
  62.  
  63. and, here's the line from "lib/header.pl", which describes this module
  64. and the file it creates:
  65.  
  66.   # variable  localfile   installed as    create-module
  67.    SysGroups  sysgroups   /etc/sysgroups  MakeSysGroups
  68.  
  69. Here are the files created by the scripts currently:
  70.  
  71.     /usr/lib/mail/ether.hosts      
  72.     /usr/local/lib/motd/motd.hosts 
  73.     /usr/lib/news/nntp_access      
  74.     /etc/ucsbhosts                 
  75.     /etc/ucsbhosts.rev             
  76.     /etc/hosts                     
  77.     /etc/named.bootBot             
  78.     /etc/named.ca                  
  79.     /etc/ucsb.subdomains           
  80.     /etc/ucsb.subdomains.rev       
  81.     /etc/sysgroups                 
  82.     /etc/networks                  
  83.  
  84. These scripts require: perl, jinx, cterm, "host"; the program "sf" (shellform)
  85. is optional, but allows the script "HE" (a form-oriented Host Entry) to
  86. work.
  87.  
  88. There is also a file "HostRegForm", which can be completed and sent via
  89. email to our "hostmaster".  Whomever is wearing the hostmaster hat that
  90. day then feeds the completed form to a script (part of this package)
  91. called "convHostForm" which then automatically updates the host database
  92. (assuming the form's input is valid).  After an update, a "make" will
  93. drive the file creation, distribution, installation, and effectation
  94. process.
  95.  
  96. named.conf.tar.Z - this directory contains a much simpler set of scripts
  97.     and a single master file to build a 3rd level subdomain, such as
  98.     "DEPT.ucsb.edu".  Several departments on our campus are using
  99.     these scripts, possibly with slight alterations.
  100.  
  101.     Uses "make" and Perl.
  102.  
  103. The Perl scripts are NOT usable without some local customization (like
  104. the Perl path, for example).  I cannot say how much will be needed; in
  105. particular, you will need to look at DNSHosts/lib/header.pl and
  106. DNSHosts/bin/*
  107.  
  108. The Jinx database requires, of course, a working installation of Jinx
  109. (and cterm, which comes with it).  If you browse around on hub, you'll
  110. also find those packages.
  111.  
  112. I do not have the time to help anyone get these working, but, the
  113. DNSHosts scripts are an *EXACT* copy of our working scripts, minus the
  114. local database.
  115.  
  116. You will need the "host" command, a program to talk to the resolver,
  117. like nslookup, but, IHMO, much simpler and nicer.  host.tar.Z is also
  118. available on hub.
  119.  
  120. If you have trouble with some of this, I'll answer questions as I can,
  121. but please be patient, and do not expect a very quick response.
  122.  
  123. Enjoy, and good luck.
  124.  
  125. Alan Stebbens   Computer Resource Manager
  126.         Center for Computational Sciences and Engineering (CCSE)
  127.         University of California, Santa Barbara
  128.         3111 Engineering I
  129.         Santa Barbara, CA 93106
  130.  
  131. Internet: aks@hub.ucsb.edu
  132. Voice:    (805) 893-8135 (CCSE Office: 893-3221)
  133.