# File: /dolomite/home/kscott/www/sysadmin/integrity/notes
# Author: K. Scott Rowe
# Time-stamp: <02/14/2000 21:37:17 kscott@bendenweir.nmt.edu>


useful DNS programs

dig [@server] [a|any|mx|ns|soa|hinfo|axfr|txt] [hs|in] name
host
nslookup
whois
  used to be maintained by internic.net
  now is maintained by many US companies such as Network Solutions
hostname
domainname

when our nmthosts file dissapeared
dig @netpeep.nmt.edu. axfr nmt.edu. > nmthosts


why use A records instead of CNAMEs
  In order to resolve a CNAME, named has to do two lookups because
  a CNAME returns a name not an IP.

Refresh:  interval when secondary servers should refresh their information
Retry:    interval when secondary servers should retry connection if failed
Expire:   interval when secondary servers should expire cached data
Keep/TTL: time-to-live retured with all queries of primary nameserver 

using DNS for redundant mailservers
cobra           IN      A       129.138.4.191
                IN      HINFO   Pentium Linux
                IN      MX      5       MAILHOST.NMT.EDU.
mailhost        IN      A       129.138.4.52
                IN      MX      0       mailhost.nmt.edu.
                IN      MX      1       rainbow.nmt.edu.



forward and reverse lookup databases

/etc/resolv.conf
  domain nmt.edu
  search nmt.edu tcct.nmt.edu
  nameserver 129.138.4.216
  nameserver 129.138.250.10
  nameserver 128.123.3.5

/etc/hosts
  #
  # If the NIS is running, this file is only consulted when booting
  #
  127.0.0.1       localhost
  #
  129.138.4.216 prism prism.nmt.edu
  129.138.4.217 quartz
  129.138.4.205 emerald
  129.138.4.208 hazel
  129.138.4.228 slate

/etc/named.conf
  // 
  // Nmt.EDU
  //
  zone "nmt.edu" {
          type master;
          file "nmthosts";
  };
  zone "138.129.in-addr.arpa" {
          type master;
          file "nmthosts.rev";
  };
  //
  // UNM
  //  129.24.8.1   ariel.unm.edu
  //
  zone "unm.edu" {
          type slave;
          file "zones/unm";
          masters {
                    129.24.8.1;
          };
  };
  zone "24.129.in-addr.arpa" {
          type slave;
          file "zones/unm.rev";
          masters {
                    129.24.8.1;
          };
  };



useful NIS commands
  ypwhich
  ypmatch
  ypcat
  make