dnsruby 1.2 → 1.23
Sign up to get free protection for your applications and to get access to all the features.
- data/demo/axfr.rb +176 -0
- data/demo/check_soa.rb +141 -0
- data/demo/check_zone.rb +157 -0
- data/demo/example_recurse.rb +11 -0
- data/demo/mresolv.rb +67 -0
- data/demo/mx.rb +33 -0
- data/demo/rubydig.rb +58 -0
- data/demo/to_resolve.txt +3088 -0
- data/demo/trace_dns.rb +15 -0
- data/doc/classes/Dnsruby.html +463 -0
- data/doc/classes/Dnsruby/Algorithms.html +171 -0
- data/doc/classes/Dnsruby/Classes.html +197 -0
- data/doc/classes/Dnsruby/Classes.src/M000209.html +23 -0
- data/doc/classes/Dnsruby/Classes.src/M000210.html +19 -0
- data/doc/classes/Dnsruby/CodeMapper.html +375 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000186.html +18 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000187.html +33 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000188.html +21 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000189.html +19 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000190.html +19 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000191.html +18 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000192.html +22 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000193.html +22 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000194.html +22 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000195.html +31 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000196.html +19 -0
- data/doc/classes/Dnsruby/Config.html +413 -0
- data/doc/classes/Dnsruby/Config.src/M000148.html +18 -0
- data/doc/classes/Dnsruby/Config.src/M000149.html +19 -0
- data/doc/classes/Dnsruby/Config.src/M000150.html +19 -0
- data/doc/classes/Dnsruby/Config.src/M000151.html +25 -0
- data/doc/classes/Dnsruby/Config.src/M000152.html +21 -0
- data/doc/classes/Dnsruby/Config.src/M000153.html +38 -0
- data/doc/classes/Dnsruby/Config.src/M000154.html +26 -0
- data/doc/classes/Dnsruby/Config.src/M000155.html +22 -0
- data/doc/classes/Dnsruby/Config.src/M000156.html +27 -0
- data/doc/classes/Dnsruby/Config.src/M000157.html +22 -0
- data/doc/classes/Dnsruby/Config.src/M000158.html +21 -0
- data/doc/classes/Dnsruby/DNS.html +571 -0
- data/doc/classes/Dnsruby/DNS.src/M000258.html +24 -0
- data/doc/classes/Dnsruby/DNS.src/M000259.html +18 -0
- data/doc/classes/Dnsruby/DNS.src/M000260.html +18 -0
- data/doc/classes/Dnsruby/DNS.src/M000261.html +20 -0
- data/doc/classes/Dnsruby/DNS.src/M000262.html +19 -0
- data/doc/classes/Dnsruby/DNS.src/M000263.html +20 -0
- data/doc/classes/Dnsruby/DNS.src/M000264.html +18 -0
- data/doc/classes/Dnsruby/DNS.src/M000265.html +19 -0
- data/doc/classes/Dnsruby/DNS.src/M000266.html +20 -0
- data/doc/classes/Dnsruby/DNS.src/M000267.html +28 -0
- data/doc/classes/Dnsruby/DNS.src/M000268.html +19 -0
- data/doc/classes/Dnsruby/DNS.src/M000269.html +20 -0
- data/doc/classes/Dnsruby/DNS.src/M000270.html +31 -0
- data/doc/classes/Dnsruby/DecodeError.html +120 -0
- data/doc/classes/Dnsruby/Dnssec.html +287 -0
- data/doc/classes/Dnsruby/Dnssec.src/M000249.html +23 -0
- data/doc/classes/Dnsruby/Dnssec.src/M000250.html +19 -0
- data/doc/classes/Dnsruby/Dnssec.src/M000251.html +90 -0
- data/doc/classes/Dnsruby/Dnssec.src/M000252.html +76 -0
- data/doc/classes/Dnsruby/EncodeError.html +120 -0
- data/doc/classes/Dnsruby/FormErr.html +119 -0
- data/doc/classes/Dnsruby/Header.html +501 -0
- data/doc/classes/Dnsruby/Header.src/M000231.html +35 -0
- data/doc/classes/Dnsruby/Header.src/M000232.html +18 -0
- data/doc/classes/Dnsruby/Header.src/M000233.html +18 -0
- data/doc/classes/Dnsruby/Header.src/M000234.html +21 -0
- data/doc/classes/Dnsruby/Header.src/M000235.html +20 -0
- data/doc/classes/Dnsruby/Header.src/M000236.html +32 -0
- data/doc/classes/Dnsruby/Header.src/M000237.html +27 -0
- data/doc/classes/Dnsruby/Header.src/M000238.html +26 -0
- data/doc/classes/Dnsruby/Header.src/M000239.html +47 -0
- data/doc/classes/Dnsruby/Header.src/M000240.html +28 -0
- data/doc/classes/Dnsruby/Header.src/M000241.html +30 -0
- data/doc/classes/Dnsruby/Hosts.html +316 -0
- data/doc/classes/Dnsruby/Hosts.src/M000197.html +20 -0
- data/doc/classes/Dnsruby/Hosts.src/M000198.html +19 -0
- data/doc/classes/Dnsruby/Hosts.src/M000199.html +20 -0
- data/doc/classes/Dnsruby/Hosts.src/M000200.html +21 -0
- data/doc/classes/Dnsruby/Hosts.src/M000201.html +19 -0
- data/doc/classes/Dnsruby/Hosts.src/M000202.html +20 -0
- data/doc/classes/Dnsruby/Hosts.src/M000203.html +21 -0
- data/doc/classes/Dnsruby/IPv4.html +233 -0
- data/doc/classes/Dnsruby/IPv4.src/M000204.html +32 -0
- data/doc/classes/Dnsruby/IPv4.src/M000205.html +19 -0
- data/doc/classes/Dnsruby/IPv4.src/M000206.html +18 -0
- data/doc/classes/Dnsruby/IPv4.src/M000207.html +18 -0
- data/doc/classes/Dnsruby/IPv4.src/M000208.html +18 -0
- data/doc/classes/Dnsruby/IPv6.html +281 -0
- data/doc/classes/Dnsruby/IPv6.src/M000242.html +60 -0
- data/doc/classes/Dnsruby/IPv6.src/M000243.html +22 -0
- data/doc/classes/Dnsruby/IPv6.src/M000244.html +20 -0
- data/doc/classes/Dnsruby/IPv6.src/M000245.html +18 -0
- data/doc/classes/Dnsruby/Message.html +803 -0
- data/doc/classes/Dnsruby/Message.src/M000119.html +38 -0
- data/doc/classes/Dnsruby/Message.src/M000120.html +26 -0
- data/doc/classes/Dnsruby/Message.src/M000121.html +22 -0
- data/doc/classes/Dnsruby/Message.src/M000122.html +22 -0
- data/doc/classes/Dnsruby/Message.src/M000123.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000124.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000125.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000126.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000127.html +18 -0
- data/doc/classes/Dnsruby/Message.src/M000128.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000129.html +23 -0
- data/doc/classes/Dnsruby/Message.src/M000130.html +30 -0
- data/doc/classes/Dnsruby/Message.src/M000131.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000132.html +18 -0
- data/doc/classes/Dnsruby/Message.src/M000133.html +56 -0
- data/doc/classes/Dnsruby/Message.src/M000134.html +35 -0
- data/doc/classes/Dnsruby/Message.src/M000135.html +46 -0
- data/doc/classes/Dnsruby/Message/Section.html +160 -0
- data/doc/classes/Dnsruby/Message/Section.src/M000141.html +29 -0
- data/doc/classes/Dnsruby/Message/Section.src/M000142.html +30 -0
- data/doc/classes/Dnsruby/MetaTypes.html +136 -0
- data/doc/classes/Dnsruby/Modes.html +171 -0
- data/doc/classes/Dnsruby/NXDomain.html +119 -0
- data/doc/classes/Dnsruby/Name.html +330 -0
- data/doc/classes/Dnsruby/Name.src/M000104.html +28 -0
- data/doc/classes/Dnsruby/Name.src/M000105.html +20 -0
- data/doc/classes/Dnsruby/Name.src/M000106.html +18 -0
- data/doc/classes/Dnsruby/Name.src/M000107.html +21 -0
- data/doc/classes/Dnsruby/Name.src/M000108.html +22 -0
- data/doc/classes/Dnsruby/Name.src/M000109.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.html +300 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000110.html +21 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000111.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000112.html +22 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000113.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000114.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000115.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000116.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000117.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000118.html +18 -0
- data/doc/classes/Dnsruby/NotImp.html +119 -0
- data/doc/classes/Dnsruby/OpCode.html +146 -0
- data/doc/classes/Dnsruby/OtherResolvError.html +119 -0
- data/doc/classes/Dnsruby/QTypes.html +146 -0
- data/doc/classes/Dnsruby/Question.html +301 -0
- data/doc/classes/Dnsruby/Question.src/M000226.html +47 -0
- data/doc/classes/Dnsruby/Question.src/M000227.html +18 -0
- data/doc/classes/Dnsruby/Question.src/M000228.html +18 -0
- data/doc/classes/Dnsruby/Question.src/M000229.html +32 -0
- data/doc/classes/Dnsruby/Question.src/M000230.html +18 -0
- data/doc/classes/Dnsruby/RCode.html +211 -0
- data/doc/classes/Dnsruby/RR.html +648 -0
- data/doc/classes/Dnsruby/RR.src/M000001.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000002.html +22 -0
- data/doc/classes/Dnsruby/RR.src/M000003.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000004.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000005.html +26 -0
- data/doc/classes/Dnsruby/RR.src/M000006.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000007.html +36 -0
- data/doc/classes/Dnsruby/RR.src/M000008.html +100 -0
- data/doc/classes/Dnsruby/RR.src/M000009.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000010.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000011.html +22 -0
- data/doc/classes/Dnsruby/RR.src/M000012.html +29 -0
- data/doc/classes/Dnsruby/RR.src/M000013.html +24 -0
- data/doc/classes/Dnsruby/RR/ANY.html +133 -0
- data/doc/classes/Dnsruby/RR/CERT.html +180 -0
- data/doc/classes/Dnsruby/RR/CERT/CertificateTypes.html +169 -0
- data/doc/classes/Dnsruby/RR/CNAME.html +151 -0
- data/doc/classes/Dnsruby/RR/DNAME.html +150 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.html +422 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000044.html +20 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000045.html +21 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000046.html +28 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000047.html +22 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000048.html +18 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000049.html +22 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000050.html +18 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000051.html +26 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000052.html +38 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000053.html +45 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000054.html +21 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000055.html +24 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000056.html +32 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000057.html +24 -0
- data/doc/classes/Dnsruby/RR/DS.html +286 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000039.html +22 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000040.html +28 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000041.html +24 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000042.html +28 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000043.html +36 -0
- data/doc/classes/Dnsruby/RR/DomainName.html +175 -0
- data/doc/classes/Dnsruby/RR/DomainName.src/M000083.html +18 -0
- data/doc/classes/Dnsruby/RR/Generic.html +133 -0
- data/doc/classes/Dnsruby/RR/HINFO.html +155 -0
- data/doc/classes/Dnsruby/RR/IN.html +155 -0
- data/doc/classes/Dnsruby/RR/IN/A.html +200 -0
- data/doc/classes/Dnsruby/RR/IN/A.src/M000017.html +18 -0
- data/doc/classes/Dnsruby/RR/IN/A.src/M000018.html +18 -0
- data/doc/classes/Dnsruby/RR/IN/A.src/M000019.html +18 -0
- data/doc/classes/Dnsruby/RR/IN/AAAA.html +139 -0
- data/doc/classes/Dnsruby/RR/IN/AFSDB.html +145 -0
- data/doc/classes/Dnsruby/RR/IN/PX.html +143 -0
- data/doc/classes/Dnsruby/RR/IN/SRV.html +238 -0
- data/doc/classes/Dnsruby/RR/IN/SRV.src/M000014.html +29 -0
- data/doc/classes/Dnsruby/RR/IN/SRV.src/M000015.html +26 -0
- data/doc/classes/Dnsruby/RR/IN/SRV.src/M000016.html +22 -0
- data/doc/classes/Dnsruby/RR/IN/WKS.html +166 -0
- data/doc/classes/Dnsruby/RR/IN/WKS.src/M000020.html +20 -0
- data/doc/classes/Dnsruby/RR/ISDN.html +155 -0
- data/doc/classes/Dnsruby/RR/LOC.html +395 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000025.html +32 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000026.html +23 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000027.html +25 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000028.html +21 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000029.html +20 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000030.html +23 -0
- data/doc/classes/Dnsruby/RR/MB.html +150 -0
- data/doc/classes/Dnsruby/RR/MG.html +150 -0
- data/doc/classes/Dnsruby/RR/MINFO.html +156 -0
- data/doc/classes/Dnsruby/RR/MR.html +150 -0
- data/doc/classes/Dnsruby/RR/MX.html +155 -0
- data/doc/classes/Dnsruby/RR/NAPTR.html +190 -0
- data/doc/classes/Dnsruby/RR/NS.html +151 -0
- data/doc/classes/Dnsruby/RR/NSAP.html +293 -0
- data/doc/classes/Dnsruby/RR/NSAP.src/M000093.html +19 -0
- data/doc/classes/Dnsruby/RR/NSAP.src/M000094.html +19 -0
- data/doc/classes/Dnsruby/RR/NSAP.src/M000095.html +22 -0
- data/doc/classes/Dnsruby/RR/NSAP.src/M000096.html +31 -0
- data/doc/classes/Dnsruby/RR/NSEC.html +301 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000031.html +19 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000032.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000033.html +34 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000034.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000035.html +71 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000036.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000037.html +80 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000038.html +23 -0
- data/doc/classes/Dnsruby/RR/NSEC3.html +366 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000085.html +28 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000086.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000087.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000088.html +22 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000089.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000090.html +21 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000091.html +21 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000092.html +29 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.html +279 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000077.html +28 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000078.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000079.html +22 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000080.html +21 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000081.html +25 -0
- data/doc/classes/Dnsruby/RR/PTR.html +132 -0
- data/doc/classes/Dnsruby/RR/RP.html +183 -0
- data/doc/classes/Dnsruby/RR/RP.src/M000082.html +19 -0
- data/doc/classes/Dnsruby/RR/RRSIG.html +357 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000097.html +26 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000098.html +28 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000099.html +23 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000100.html +23 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000101.html +46 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000102.html +50 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000103.html +27 -0
- data/doc/classes/Dnsruby/RR/RT.html +155 -0
- data/doc/classes/Dnsruby/RR/SOA.html +233 -0
- data/doc/classes/Dnsruby/RR/SOA.src/M000066.html +24 -0
- data/doc/classes/Dnsruby/RR/SOA.src/M000067.html +27 -0
- data/doc/classes/Dnsruby/RR/SPF.html +138 -0
- data/doc/classes/Dnsruby/RR/TKEY.html +313 -0
- data/doc/classes/Dnsruby/RR/TKEY.src/M000021.html +19 -0
- data/doc/classes/Dnsruby/RR/TKEY.src/M000022.html +29 -0
- data/doc/classes/Dnsruby/RR/TKEY.src/M000023.html +21 -0
- data/doc/classes/Dnsruby/RR/TKEY.src/M000024.html +29 -0
- data/doc/classes/Dnsruby/RR/TSIG.html +524 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000068.html +24 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000069.html +32 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000070.html +54 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000071.html +121 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000072.html +33 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000073.html +25 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000074.html +36 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000075.html +22 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000076.html +29 -0
- data/doc/classes/Dnsruby/RR/TXT.html +233 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000061.html +18 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000062.html +18 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000063.html +20 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000064.html +27 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000065.html +25 -0
- data/doc/classes/Dnsruby/RR/X25.html +203 -0
- data/doc/classes/Dnsruby/RR/X25.src/M000058.html +18 -0
- data/doc/classes/Dnsruby/RR/X25.src/M000059.html +18 -0
- data/doc/classes/Dnsruby/RR/X25.src/M000060.html +22 -0
- data/doc/classes/Dnsruby/RRSet.html +404 -0
- data/doc/classes/Dnsruby/RRSet.src/M000211.html +23 -0
- data/doc/classes/Dnsruby/RRSet.src/M000212.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000213.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000214.html +47 -0
- data/doc/classes/Dnsruby/RRSet.src/M000215.html +42 -0
- data/doc/classes/Dnsruby/RRSet.src/M000216.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000217.html +20 -0
- data/doc/classes/Dnsruby/RRSet.src/M000218.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000219.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000220.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000221.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000222.html +22 -0
- data/doc/classes/Dnsruby/RRSet.src/M000223.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000224.html +22 -0
- data/doc/classes/Dnsruby/RRSet.src/M000225.html +18 -0
- data/doc/classes/Dnsruby/Refused.html +119 -0
- data/doc/classes/Dnsruby/Resolv.html +401 -0
- data/doc/classes/Dnsruby/Resolv.src/M000159.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000160.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000161.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000162.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000163.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000164.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000165.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000166.html +19 -0
- data/doc/classes/Dnsruby/Resolv.src/M000167.html +20 -0
- data/doc/classes/Dnsruby/Resolv.src/M000168.html +29 -0
- data/doc/classes/Dnsruby/Resolv.src/M000169.html +19 -0
- data/doc/classes/Dnsruby/Resolv.src/M000170.html +20 -0
- data/doc/classes/Dnsruby/Resolv.src/M000171.html +25 -0
- data/doc/classes/Dnsruby/ResolvError.html +117 -0
- data/doc/classes/Dnsruby/ResolvTimeout.html +117 -0
- data/doc/classes/Dnsruby/Resolver.html +1055 -0
- data/doc/classes/Dnsruby/Resolver.src/M000271.html +21 -0
- data/doc/classes/Dnsruby/Resolver.src/M000272.html +27 -0
- data/doc/classes/Dnsruby/Resolver.src/M000273.html +28 -0
- data/doc/classes/Dnsruby/Resolver.src/M000274.html +18 -0
- data/doc/classes/Dnsruby/Resolver.src/M000275.html +51 -0
- data/doc/classes/Dnsruby/Resolver.src/M000276.html +21 -0
- data/doc/classes/Dnsruby/Resolver.src/M000277.html +22 -0
- data/doc/classes/Dnsruby/Resolver.src/M000278.html +18 -0
- data/doc/classes/Dnsruby/Resolver.src/M000279.html +20 -0
- data/doc/classes/Dnsruby/Resolver.src/M000280.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000281.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000282.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000283.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000284.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000285.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000286.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000287.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000288.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000289.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000290.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000291.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000292.html +26 -0
- data/doc/classes/Dnsruby/Resolver.src/M000293.html +18 -0
- data/doc/classes/Dnsruby/Resolver.src/M000294.html +23 -0
- data/doc/classes/Dnsruby/Resolver.src/M000295.html +18 -0
- data/doc/classes/Dnsruby/ServFail.html +119 -0
- data/doc/classes/Dnsruby/SingleResolver.html +674 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000172.html +18 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000173.html +24 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000174.html +36 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000175.html +18 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000176.html +19 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000177.html +50 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000178.html +19 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000179.html +21 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000180.html +25 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000181.html +54 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000182.html +27 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000183.html +27 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000184.html +35 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000185.html +21 -0
- data/doc/classes/Dnsruby/TheLog.html +196 -0
- data/doc/classes/Dnsruby/TheLog.src/M000246.html +20 -0
- data/doc/classes/Dnsruby/TheLog.src/M000247.html +20 -0
- data/doc/classes/Dnsruby/TheLog.src/M000248.html +20 -0
- data/doc/classes/Dnsruby/Types.html +436 -0
- data/doc/classes/Dnsruby/Update.html +368 -0
- data/doc/classes/Dnsruby/Update.src/M000253.html +32 -0
- data/doc/classes/Dnsruby/Update.src/M000254.html +36 -0
- data/doc/classes/Dnsruby/Update.src/M000255.html +32 -0
- data/doc/classes/Dnsruby/Update.src/M000256.html +41 -0
- data/doc/classes/Dnsruby/Update.src/M000257.html +34 -0
- data/doc/classes/Dnsruby/VerifyError.html +119 -0
- data/doc/classes/Dnsruby/ZoneTransfer.html +300 -0
- data/doc/classes/Dnsruby/ZoneTransfer.src/M000143.html +18 -0
- data/doc/classes/Dnsruby/ZoneTransfer.src/M000144.html +24 -0
- data/doc/classes/Dnsruby/ZoneTransfer.src/M000145.html +35 -0
- data/doc/classes/Dnsruby/ZoneTransfer/Delta.html +200 -0
- data/doc/classes/Dnsruby/ZoneTransfer/Delta.src/M000146.html +19 -0
- data/doc/classes/Dnsruby/ZoneTransfer/Delta.src/M000147.html +19 -0
- data/doc/created.rid +1 -0
- data/doc/files/lib/Dnsruby/Config_rb.html +101 -0
- data/doc/files/lib/Dnsruby/DNS_rb.html +110 -0
- data/doc/files/lib/Dnsruby/Hosts_rb.html +108 -0
- data/doc/files/lib/Dnsruby/Resolver_rb.html +109 -0
- data/doc/files/lib/Dnsruby/SingleResolver_rb.html +108 -0
- data/doc/files/lib/Dnsruby/TheLog_rb.html +110 -0
- data/doc/files/lib/Dnsruby/code_mapper_rb.html +101 -0
- data/doc/files/lib/Dnsruby/dnssec_rb.html +107 -0
- data/doc/files/lib/Dnsruby/event_machine_interface_rb.html +108 -0
- data/doc/files/lib/Dnsruby/ipv4_rb.html +101 -0
- data/doc/files/lib/Dnsruby/ipv6_rb.html +101 -0
- data/doc/files/lib/Dnsruby/message_rb.html +109 -0
- data/doc/files/lib/Dnsruby/name_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/AAAA_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/AFSDB_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/A_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/CERT_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/DNSKEY_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/DS_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/HINFO_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/IN_rb.html +112 -0
- data/doc/files/lib/Dnsruby/resource/ISDN_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/LOC_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/MINFO_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/MX_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NAPTR_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NSAP_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NSEC3PARAM_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NSEC3_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NSEC_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/OPT_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/PX_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/RP_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/RRSIG_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/RT_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/SOA_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/SPF_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/SRV_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/TKEY_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/TSIG_rb.html +114 -0
- data/doc/files/lib/Dnsruby/resource/TXT_rb.html +108 -0
- data/doc/files/lib/Dnsruby/resource/X25_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/domain_name_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/generic_rb.html +131 -0
- data/doc/files/lib/Dnsruby/resource/resource_rb.html +110 -0
- data/doc/files/lib/Dnsruby/select_thread_rb.html +111 -0
- data/doc/files/lib/Dnsruby/update_rb.html +101 -0
- data/doc/files/lib/Dnsruby/zone_transfer_rb.html +101 -0
- data/doc/files/lib/dnsruby_rb.html +118 -0
- data/doc/fr_class_index.html +108 -0
- data/doc/fr_file_index.html +75 -0
- data/doc/fr_method_index.html +321 -0
- data/doc/index.html +24 -0
- data/lib/Dnsruby/DNS.rb +3 -3
- data/lib/Dnsruby/Resolver.rb +11 -2
- data/lib/Dnsruby/SingleResolver.rb +28 -20
- data/lib/Dnsruby/code_mapper.rb +9 -4
- data/lib/Dnsruby/dnssec.rb +6 -3
- data/lib/Dnsruby/message.rb +108 -32
- data/lib/Dnsruby/resource/DLV.rb +27 -0
- data/lib/Dnsruby/resource/DNSKEY.rb +29 -7
- data/lib/Dnsruby/resource/DS.rb +97 -18
- data/lib/Dnsruby/resource/DS.rb.new +202 -0
- data/lib/Dnsruby/resource/DS.rb.orig +162 -0
- data/lib/Dnsruby/resource/NSEC.rb +22 -6
- data/lib/Dnsruby/resource/OPT.rb +14 -13
- data/lib/Dnsruby/resource/PX.rb +1 -1
- data/lib/Dnsruby/resource/RRSIG.rb +17 -9
- data/lib/Dnsruby/resource/RT.rb +1 -1
- data/lib/Dnsruby/resource/TSIG.rb +4 -0
- data/lib/Dnsruby/resource/generic.rb +2 -1
- data/lib/Dnsruby/resource/resource.rb +23 -8
- data/lib/Dnsruby/select_thread.rb +15 -7
- data/lib/Dnsruby/update.rb +3 -3
- data/lib/Dnsruby/zone_transfer.rb +1 -1
- data/lib/dnsruby.rb +4 -2
- data/test/tc_dns.rb +1 -1
- data/test/tc_ds.rb +47 -4
- data/test/tc_em_deferrable.rb +38 -0
- data/test/tc_event_machine_res.rb +1 -1
- data/test/tc_header.rb +2 -2
- data/test/tc_inet6.rb +170 -0
- data/test/tc_nsec3.rb +6 -5
- data/test/tc_packet.rb +18 -4
- data/test/tc_queue.rb +17 -0
- data/test/tc_resolver.rb +14 -14
- data/test/tc_rr-opt.rb +21 -2
- data/test/tc_rr.rb +4 -0
- data/test/tc_rrset.rb +2 -2
- data/test/tc_rrsig.rb +2 -2
- data/test/tc_tcp.rb +1 -1
- data/test/tc_tsig.rb +6 -6
- data/test/ts_offline.rb +17 -2
- data/test/ts_online.rb +4 -0
- metadata +496 -3
data/demo/axfr.rb
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
#= NAME
|
2
|
+
#
|
3
|
+
#axfr - Perform a DNS zone transfer
|
4
|
+
#
|
5
|
+
#= SYNOPSIS
|
6
|
+
#
|
7
|
+
#axfr [ -fqs ] [ -D directory ] [ @nameserver ] zone
|
8
|
+
#
|
9
|
+
#= DESCRIPTION
|
10
|
+
#
|
11
|
+
#axfr performs a DNS zone transfer, prints each record to the standard
|
12
|
+
#output, and stores the zone to a file. If the zone has already been
|
13
|
+
#stored in a file, axfr will read the file instead of performing a
|
14
|
+
#zone transfer.
|
15
|
+
#
|
16
|
+
#Zones will be stored in a directory hierarchy. For example, the
|
17
|
+
#zone transfer for foo.bar.com will be stored in the file
|
18
|
+
# HOME/.dns-zones/com/bar/foo/axfr. The directory can be changed
|
19
|
+
# with the B<-D> option.
|
20
|
+
#
|
21
|
+
# This programs requires that the Storable module be installed.
|
22
|
+
#
|
23
|
+
#= OPTIONS
|
24
|
+
#
|
25
|
+
# * -f Force a zone transfer, even if the zone has already been stored
|
26
|
+
# in a file.
|
27
|
+
#
|
28
|
+
# * -q Be quiet -- don't print the records from the zone.
|
29
|
+
#
|
30
|
+
# * -s Perform a zone transfer if the SOA serial number on the nameserver
|
31
|
+
# is different than the serial number in the zone file.
|
32
|
+
#
|
33
|
+
# * -D directory Store zone files under I<directory> instead of the default directory (see "FILES")
|
34
|
+
#
|
35
|
+
# * nameserver Query nameserver instead of the default nameserver.
|
36
|
+
#
|
37
|
+
#= FILES
|
38
|
+
#
|
39
|
+
# * ${HOME}/.dns-zones Default directory for storing zone files.
|
40
|
+
#
|
41
|
+
#= AUTHOR
|
42
|
+
#
|
43
|
+
# Michael Fuhr <mike@fuhr.org>
|
44
|
+
#
|
45
|
+
|
46
|
+
require 'GetoptLong'
|
47
|
+
require 'Dnsruby'
|
48
|
+
|
49
|
+
#------------------------------------------------------------------------------
|
50
|
+
# Read any command-line options and check syntax.
|
51
|
+
#------------------------------------------------------------------------------
|
52
|
+
|
53
|
+
#getopts("fqsD:");
|
54
|
+
opts = GetoptLong.new(["-f", GetoptLong::NO_ARGUMENT],
|
55
|
+
["-q", GetoptLong::NO_ARGUMENT],
|
56
|
+
["-D", GetoptLong::REQUIRED_ARGUMENT],
|
57
|
+
["-s", GetoptLong::NO_ARGUMENT])
|
58
|
+
|
59
|
+
opt_q = false
|
60
|
+
opt_f = false
|
61
|
+
opt_s = false
|
62
|
+
opt_d = nil
|
63
|
+
opts.each do |opt, arg|
|
64
|
+
case opt
|
65
|
+
when '-q'
|
66
|
+
opt_q=true
|
67
|
+
when '-f'
|
68
|
+
opt_f = true
|
69
|
+
when '-s'
|
70
|
+
opt_s = true
|
71
|
+
when '-D'
|
72
|
+
opt_d = arg
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
if (ARGV.length < 1) || (ARGV.length > 2)
|
77
|
+
print "Usage: #{$0} [ -fqs ] [ -D directory ] [ @nameserver ] zone\n"
|
78
|
+
else
|
79
|
+
#------------------------------------------------------------------------------
|
80
|
+
# Get the nameserver (if specified) and set up the zone transfer directory
|
81
|
+
# hierarchy.
|
82
|
+
#------------------------------------------------------------------------------
|
83
|
+
|
84
|
+
nameserver = (ARGV[0] =~ /^@/) ? ARGV.shift : ""
|
85
|
+
nameserver = nameserver.sub(/^@/, "")
|
86
|
+
|
87
|
+
zone = ARGV.shift
|
88
|
+
basedir = opt_d!=nil ? opt_d : (ENV["HOME"]!=nil ? ENV["HOME"] : "") + "/.dns-zones"
|
89
|
+
zonedir = zone.split(/\./).reverse.join("/")
|
90
|
+
zonefile = basedir + "/" + zonedir + "/axfr"
|
91
|
+
|
92
|
+
# Don't worry about the 0777 permissions here - the current umask setting
|
93
|
+
# will be applied.
|
94
|
+
if !(FileTest.directory?basedir)
|
95
|
+
Dir.mkdir(basedir, 0777) or raise RuntimeError, "can't mkdir #{basedir}: #{$!}\n"
|
96
|
+
end
|
97
|
+
|
98
|
+
dir = basedir
|
99
|
+
zonedir.split("/").each do |subdir|
|
100
|
+
dir += "/" + subdir
|
101
|
+
if (!FileTest.directory?dir)
|
102
|
+
Dir.mkdir(dir, 0777) or raise RuntimeError, "can't mkdir #{dir}: #{$!}\n"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
#------------------------------------------------------------------------------
|
107
|
+
# Get the zone.
|
108
|
+
#------------------------------------------------------------------------------
|
109
|
+
|
110
|
+
zonearray = nil
|
111
|
+
|
112
|
+
if (FileTest.exist?(zonefile) && !opt_f)
|
113
|
+
zoneref = Marshal.load(File.open(zonefile))
|
114
|
+
if (zoneref==nil)
|
115
|
+
raise RuntimeError, "couldn't retrieve zone from #{zonefile}: #{$!}\n"
|
116
|
+
end
|
117
|
+
|
118
|
+
#----------------------------------------------------------------------
|
119
|
+
# Check the SOA serial number if desired.
|
120
|
+
#----------------------------------------------------------------------
|
121
|
+
|
122
|
+
if (opt_s)
|
123
|
+
serial_file, serial_zone = nil
|
124
|
+
|
125
|
+
zoneref.each do |rr|
|
126
|
+
if (rr.type == "SOA")
|
127
|
+
serial_file = rr.serial
|
128
|
+
break
|
129
|
+
end
|
130
|
+
end
|
131
|
+
if serial_file==nil
|
132
|
+
raise RuntimeError, "no SOA in #{zonefile}\n"
|
133
|
+
end
|
134
|
+
|
135
|
+
soa = res.query(zone, "SOA")
|
136
|
+
if soa==nil
|
137
|
+
raise RuntimeError, "couldn't get SOA for #{zone}: " + res.errorstring + "\n"
|
138
|
+
end
|
139
|
+
|
140
|
+
soa.answer.each do |rr|
|
141
|
+
if (rr.type == "SOA")
|
142
|
+
serial_zone = rr.serial
|
143
|
+
break
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
if (serial_zone != serial_file)
|
148
|
+
opt_f = true
|
149
|
+
end
|
150
|
+
end
|
151
|
+
else
|
152
|
+
opt_f = true
|
153
|
+
end
|
154
|
+
|
155
|
+
if (opt_f)
|
156
|
+
print "nameserver = #{nameserver}, zone=#{zone}"
|
157
|
+
zt = Dnsruby::ZoneTransfer.new
|
158
|
+
zt.server=(nameserver) if nameserver!=""
|
159
|
+
|
160
|
+
zoneref = zt.transfer(zone)
|
161
|
+
if zoneref==nil
|
162
|
+
raise RuntimeError, "couldn't transfer zone: " + res.errorstring + "\n"
|
163
|
+
end
|
164
|
+
Marshal.dump(zoneref, File.open(zonefile, File::CREAT|File::RDWR))
|
165
|
+
end
|
166
|
+
|
167
|
+
#------------------------------------------------------------------------------
|
168
|
+
# Print the records in the zone.
|
169
|
+
#------------------------------------------------------------------------------
|
170
|
+
|
171
|
+
if (!opt_q)
|
172
|
+
zoneref.each do |z|
|
173
|
+
print z.to_s + "\n"
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
data/demo/check_soa.rb
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
#= NAME
|
2
|
+
#
|
3
|
+
#check_soa - Check a domain's nameservers
|
4
|
+
#
|
5
|
+
#= SYNOPSIS
|
6
|
+
#
|
7
|
+
#check_soa domain
|
8
|
+
#
|
9
|
+
#= DESCRIPTION
|
10
|
+
#
|
11
|
+
#check_soa queries each of a domain's nameservers for the Start
|
12
|
+
#of Authority (SOA) record and prints the serial number. Errors
|
13
|
+
#are printed for nameservers that couldn't be reached or didn't
|
14
|
+
#answer authoritatively.
|
15
|
+
#
|
16
|
+
#= AUTHOR
|
17
|
+
#
|
18
|
+
#The original Bourne Shell and C versions were printed in
|
19
|
+
#"DNS and BIND" by Paul Albitz & Cricket Liu.
|
20
|
+
#
|
21
|
+
#This Perl version was written by Michael Fuhr <mike@fuhr.org>.
|
22
|
+
#
|
23
|
+
#= SEE ALSO
|
24
|
+
#
|
25
|
+
#axfr, check_zone, mresolv, mx, perldig, Net::DNS
|
26
|
+
|
27
|
+
require 'Dnsruby'
|
28
|
+
|
29
|
+
#------------------------------------------------------------------------------
|
30
|
+
# Get the domain from the command line.
|
31
|
+
#------------------------------------------------------------------------------
|
32
|
+
|
33
|
+
if ARGV.length ==1
|
34
|
+
domain = ARGV[0]
|
35
|
+
|
36
|
+
#------------------------------------------------------------------------------
|
37
|
+
# Find all the nameservers for the domain.
|
38
|
+
#------------------------------------------------------------------------------
|
39
|
+
|
40
|
+
res = Dnsruby::Resolver.new
|
41
|
+
|
42
|
+
# res.defnames=(0)
|
43
|
+
res.retry_times=(2)
|
44
|
+
ns_req = nil
|
45
|
+
begin
|
46
|
+
ns_req = res.query(domain, "NS")
|
47
|
+
rescue Exception => e
|
48
|
+
print "Error : #{e}"
|
49
|
+
return
|
50
|
+
end
|
51
|
+
if (ns_req.header.ancount == 0)
|
52
|
+
print "No nameservers found for #{domain}\n"
|
53
|
+
return
|
54
|
+
end
|
55
|
+
|
56
|
+
# Send out non-recursive queries
|
57
|
+
res.recurse=(0)
|
58
|
+
|
59
|
+
|
60
|
+
#------------------------------------------------------------------------------
|
61
|
+
# Check the SOA record on each nameserver.
|
62
|
+
#------------------------------------------------------------------------------
|
63
|
+
|
64
|
+
(ns_req.answer.select {|r| r.type == "NS"}).each do |nsrr|
|
65
|
+
|
66
|
+
#----------------------------------------------------------------------
|
67
|
+
# Set the resolver to query this nameserver.
|
68
|
+
#----------------------------------------------------------------------
|
69
|
+
ns = nsrr.domainname
|
70
|
+
|
71
|
+
# In order to lookup the IP(s) of the nameserver, we need a Resolver
|
72
|
+
# object that is set to our local, recursive nameserver. So we create
|
73
|
+
# a new object just to do that.
|
74
|
+
|
75
|
+
local_res = Dnsruby::Resolver.new
|
76
|
+
a_req=nil
|
77
|
+
begin
|
78
|
+
a_req = local_res.query(ns, 'A')
|
79
|
+
rescue Exception => e
|
80
|
+
print "Can not find address for #{ns}: #{e}\n"
|
81
|
+
next
|
82
|
+
end
|
83
|
+
|
84
|
+
(a_req.answer.select {|r| r.type == 'A'}).each do |r|
|
85
|
+
ip = r.address
|
86
|
+
#----------------------------------------------------------------------
|
87
|
+
# Ask this IP.
|
88
|
+
#----------------------------------------------------------------------
|
89
|
+
|
90
|
+
res.nameserver=(ip.to_s)
|
91
|
+
|
92
|
+
print "#{ns} (#{ip}): "
|
93
|
+
|
94
|
+
#----------------------------------------------------------------------
|
95
|
+
# Get the SOA record.
|
96
|
+
#----------------------------------------------------------------------
|
97
|
+
soa_req=nil
|
98
|
+
begin
|
99
|
+
soa_req = res.query(domain, 'SOA', 'IN')
|
100
|
+
rescue Exception => e
|
101
|
+
print "Error : #{e}\n"
|
102
|
+
next
|
103
|
+
end
|
104
|
+
|
105
|
+
#----------------------------------------------------------------------
|
106
|
+
# Is this nameserver authoritative for the domain?
|
107
|
+
#----------------------------------------------------------------------
|
108
|
+
|
109
|
+
unless (soa_req.header.aa)
|
110
|
+
print "isn't authoritative for #{domain}\n"
|
111
|
+
next
|
112
|
+
end
|
113
|
+
|
114
|
+
#----------------------------------------------------------------------
|
115
|
+
# We should have received exactly one answer.
|
116
|
+
#----------------------------------------------------------------------
|
117
|
+
|
118
|
+
unless (soa_req.header.ancount == 1)
|
119
|
+
print "expected 1 answer, got ", soa_req.header.ancount, "\n"
|
120
|
+
next
|
121
|
+
end
|
122
|
+
|
123
|
+
#----------------------------------------------------------------------
|
124
|
+
# Did we receive an SOA record?
|
125
|
+
#----------------------------------------------------------------------
|
126
|
+
|
127
|
+
unless ((soa_req.answer)[0].type == "SOA")
|
128
|
+
print "expected SOA, got ", (soa_req.answer)[0].type, "\n"
|
129
|
+
next
|
130
|
+
end
|
131
|
+
|
132
|
+
#----------------------------------------------------------------------
|
133
|
+
# Print the serial number.
|
134
|
+
#----------------------------------------------------------------------
|
135
|
+
|
136
|
+
print "has serial number ", (soa_req.answer)[0].serial, "\n"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else
|
140
|
+
print "Usage: #{$0} domain\n"
|
141
|
+
end
|
data/demo/check_zone.rb
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
#= NAME
|
2
|
+
#
|
3
|
+
#check_zone - Check a DNS zone for errors
|
4
|
+
#
|
5
|
+
#= SYNOPSIS
|
6
|
+
#
|
7
|
+
#check_zone [ -r ] <domain>
|
8
|
+
#
|
9
|
+
#= DESCRIPTION
|
10
|
+
#
|
11
|
+
#Checks a DNS zone for errors. Current checks are:
|
12
|
+
#
|
13
|
+
#* Checks that all A records have corresponding PTR records.
|
14
|
+
#
|
15
|
+
#* Checks that hosts listed in NS, MX, and CNAME records have
|
16
|
+
#A records.
|
17
|
+
#
|
18
|
+
#= OPTIONS
|
19
|
+
#
|
20
|
+
#* -r Perform a recursive check on subdomains.
|
21
|
+
#
|
22
|
+
#= AUTHOR
|
23
|
+
#
|
24
|
+
#Michael Fuhr <mike@fuhr.org>
|
25
|
+
#(Ruby version AlexD, Nominet UK)
|
26
|
+
#
|
27
|
+
|
28
|
+
|
29
|
+
require 'Dnsruby'
|
30
|
+
require 'GetoptLong'
|
31
|
+
|
32
|
+
def check_domain(args)
|
33
|
+
domain = args[0]
|
34
|
+
klass = "IN"
|
35
|
+
if (args.length > 1)
|
36
|
+
klass = args[1]
|
37
|
+
end
|
38
|
+
print "----------------------------------------------------------------------\n"
|
39
|
+
print "#{domain} (class #{klass}\n"
|
40
|
+
print "\n"
|
41
|
+
|
42
|
+
res = Dnsruby::Resolver.new
|
43
|
+
res.retry_times=(2)
|
44
|
+
nspack = nil
|
45
|
+
begin
|
46
|
+
nspack = res.query(domain, "NS", klass)
|
47
|
+
rescue Exception => e
|
48
|
+
print "Couldn't find nameservers for #{domain}: #{e}\n"
|
49
|
+
return
|
50
|
+
end
|
51
|
+
|
52
|
+
print "nameservers (will request zone from first available):\n"
|
53
|
+
ns=""
|
54
|
+
(nspack.answer.select {|r| r.type == "NS"}).each do |ns|
|
55
|
+
print "\t", ns.domainname, "\n"
|
56
|
+
end
|
57
|
+
print "\n"
|
58
|
+
|
59
|
+
res.nameserver= (nspack.answer.select {|i| i.type == "NS"}).collect {|i| i.domainname.to_s}
|
60
|
+
|
61
|
+
zt = Dnsruby::ZoneTransfer.new
|
62
|
+
zt.server=(nspack.answer.select {|i| i.type == "NS"}).collect {|i| i.domainname.to_s}
|
63
|
+
zone = zt.transfer(domain) # , klass)
|
64
|
+
unless (zone)
|
65
|
+
print "Zone transfer failed: ", res.errorstring, "\n"
|
66
|
+
return
|
67
|
+
end
|
68
|
+
|
69
|
+
print "checking PTR records\n"
|
70
|
+
check_ptr(domain, klass, zone)
|
71
|
+
print "\n"
|
72
|
+
|
73
|
+
print "checking NS records\n"
|
74
|
+
check_ns(domain, klass, zone)
|
75
|
+
print "\n"
|
76
|
+
|
77
|
+
print "checking MX records\n"
|
78
|
+
check_mx(domain, klass, zone)
|
79
|
+
print "\n"
|
80
|
+
|
81
|
+
print "checking CNAME records\n"
|
82
|
+
check_cname(domain, klass, zone)
|
83
|
+
print "\n"
|
84
|
+
|
85
|
+
if (@recurse)
|
86
|
+
print "checking subdomains\n\n"
|
87
|
+
subdomains = Hash.new
|
88
|
+
# foreach (grep { $_->type eq "NS" and $_->name ne $domain } @zone) {
|
89
|
+
(zone.select {|i| i.type == "NS" && i.name != domain}).each do |z|
|
90
|
+
subdomains[z.name] = 1
|
91
|
+
end
|
92
|
+
# foreach (sort keys %subdomains) {
|
93
|
+
subdomains.keys.sort.each do |k|
|
94
|
+
check_domain(k, klass)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def check_ptr(domain, klass, zone)
|
100
|
+
res = Dnsruby::Resolver.new
|
101
|
+
# foreach $rr (grep { $_->type eq "A" } @zone) {
|
102
|
+
(zone.select {|z| z.type == "A"}).each do |rr|
|
103
|
+
host = rr.name
|
104
|
+
addr = rr.address
|
105
|
+
ans= nil
|
106
|
+
begin
|
107
|
+
ans = res.query(addr.to_s, "A") #, klass)
|
108
|
+
print "\t#{host} (#{addr}) has no PTR record\n" if (ans.header.ancount < 1)
|
109
|
+
rescue Dnsruby::NXDomain
|
110
|
+
print "\t#{host} (#{addr}) returns NXDomain\n"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def check_ns(domain, klass, zone)
|
116
|
+
res = Dnsruby::Resolver.new
|
117
|
+
# foreach $rr (grep { $_->type eq "NS" } @zone) {
|
118
|
+
(zone.select { |z| z.type == "NS" }).each do |rr|
|
119
|
+
ans = res.query(rr.nsdname, "A", klass)
|
120
|
+
print "\t", rr.nsdname, " has no A record\n" if (ans.header.ancount < 1)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def check_mx(domain, klass, zone)
|
125
|
+
res = Dnsruby::Resolver.new
|
126
|
+
# foreach $rr (grep { $_->type eq "MX" } @zone) {
|
127
|
+
zone.select {|z| z.type == "MX"}.each do |rr|
|
128
|
+
ans = res.query(rr.exchange, "A", klass)
|
129
|
+
print "\t", rr.exchange, " has no A record\n" if (ans.header.ancount < 1)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def check_cname(domain, klass, zone)
|
134
|
+
res = Dnsruby::Resolver.new
|
135
|
+
# foreach $rr (grep { $_->type eq "CNAME" } @zone)
|
136
|
+
zone.select {|z| z.type == "CNAME"}.each do |rr|
|
137
|
+
ans = res.query(rr.cname, "A", klass)
|
138
|
+
print "\t", rr.cname, " has no A record\n" if (ans.header.ancount < 1)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
opts = GetoptLong.new(["-r", GetoptLong::NO_ARGUMENT])
|
143
|
+
@recurse = false
|
144
|
+
opts.each do |opt, arg|
|
145
|
+
case opt
|
146
|
+
when '-r'
|
147
|
+
@recurse=true
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
if (ARGV.length >=1 && ARGV.length <=2)
|
152
|
+
|
153
|
+
check_domain(ARGV)
|
154
|
+
exit
|
155
|
+
else
|
156
|
+
print "Usage: #{$0} [ -r ] domain [ class ]\n"
|
157
|
+
end
|