dnstools 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -2,11 +2,11 @@ require 'thor'
2
2
  require 'resolv'
3
3
 
4
4
  module DNSTools
5
- VERSION = '1.0.3'
5
+ VERSION = '1.0.4'
6
6
 
7
7
  class Commands < Thor
8
8
  end
9
9
 
10
10
  end
11
11
 
12
- require 'dns_tools/serial_check'
12
+ require 'dns_tools/ns_check'
@@ -1,9 +1,9 @@
1
1
  module DNSTools
2
2
  class Commands
3
3
 
4
- desc "serialcheck example.com", "Checks the serial number for all a domain's nameservers is the same on all records"
5
- def serialcheck(domain)
6
- root_resolver = Resolv::DNS.new(:nameserver => ['8.8.8.8'])
4
+ desc "nscheck example.com", "Checks the NS records for a domain and ensures they all return the same data"
5
+ def nscheck(domain)
6
+ root_resolver = Resolv::DNS.new(:nameserver => ['8.8.8.8', '141.1.1.1', '8.8.4.4'])
7
7
 
8
8
  nameservers = root_resolver.getresources(domain, Resolv::DNS::Resource::IN::NS)
9
9
  serials = []
@@ -15,11 +15,14 @@ module DNSTools
15
15
 
16
16
  soa = ns_resolver.getresource(domain, Resolv::DNS::Resource::IN::SOA)
17
17
  if soa
18
- puts "OK (#{soa.serial})"
18
+ ip = root_resolver.getresource(ns.name.to_s, Resolv::DNS::Resource::IN::ANY)
19
+ print ip.address.to_s.ljust(25)
20
+ print soa.serial
19
21
  serials << soa.serial
20
22
  else
21
23
  puts "No SOA record found"
22
24
  end
25
+ puts
23
26
  $stdout.flush
24
27
  end
25
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnstools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-11-15 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70261405098500 !ruby/object:Gem::Requirement
16
+ requirement: &70352182662860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.16.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70261405098500
24
+ version_requirements: *70352182662860
25
25
  description:
26
26
  email: adam@atechmedia.com
27
27
  executables:
@@ -31,8 +31,9 @@ extra_rdoc_files: []
31
31
  files:
32
32
  - bin/dnstools
33
33
  - dnstools-1.0.2.gem
34
+ - dnstools-1.0.3.gem
34
35
  - dnstools.gemspec
35
- - lib/dns_tools/serial_check.rb
36
+ - lib/dns_tools/ns_check.rb
36
37
  - lib/dns_tools.rb
37
38
  homepage: http://atechmedia.com
38
39
  licenses: []