Title: dns commands Subject: short examples of using dns commands. --------------------------------------------------------------------------- FILES /etc/named.conf default name server configu­ ration file /var/run/named.pid (_PATH_PIDFILE) the process id /var/tmp/named_dump.db (_PATH_DUMPFILE) dump of the name server database /var/tmp/named.run (file: _PATH_DEBUG) debug output /var/tmp/named.stats (file: _PATH_STATS) nameserver statistics data --------------------------------------------------------------------------- hostname mother.stilen.com --------------------------------------------------------- NOTE: This is to see who holds the mx records for the domain. ------------------------------------------------------------ nslookup -querytype=mx stilen.com Server: dns1-sac.scrm01.pacbell.net Address: 206.13.31.12 Authoritative answers can be found from: stilen.com origin = NS11.WORLDNIC.COM mail addr = namehost.WORLDNIC.COM serial = 2000042800 refresh = 3600 (1H) retry = 3600 (1H) expire = 432000 (5D) minimum ttl = 86400 (1D) ------------------------------------------------------------- nslookup -querytype=mx linux.org Server: dns1-sac.scrm01.pacbell.net Address: 206.13.31.12 Non-authoritative answer: linux.org preference = 10, mail exchanger = mail.linux.org linux.org preference = 20, mail exchanger = router.invlogic.com linux.org preference = 30, mail exchanger = border-ai.invlogic.com Authoritative answers can be found from: linux.org nameserver = NS.invlogic.com linux.org nameserver = NS0.AITCOM.NET mail.linux.org internet address = 198.182.196.60 router.invlogic.com internet address = 198.182.196.1 border-ai.invlogic.com internet address = 205.134.175.254 NS.invlogic.com internet address = 205.134.175.254 NS0.AITCOM.NET internet address = 208.234.1.34 -------------------------------------------------------------- ============================================================== Shell script ============================================================== PLAN FOR PROJECT nslookup >set type=ns >domain_name1.com domain_name2.comdomain_name3.com Grab lines that contain "nameserver", weed out duplicates > set type=SOA turn off recurse so ns doesn't query a non-SOA > set norecurse see responce when srver does not have the SOA record (this output went to stderr) > mit.edu Test a positive responce > server strawb.mit.edu > mit.edu If the server had looked up the SOA and chached it, the name server would have returned the SOA record, and said "non-authoritative" When the server has the SOA record, and it is Authoritative, we grab the line "serial" Now we need to see what it looks like when the name server is down (this output went to stderr) > server galt.cs.purdue.edu > set type=soa > mit.edu -------------------------------------------------------------- CODE: in progress.