dnslookup 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dnslookup.rb +9 -6
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a110bf29412e180a1d4223851aabdf96d46fa46e
|
4
|
+
data.tar.gz: 3e9b6c957ef478809b2b282993f7cc148703b933
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76353e3ac9c7444008531ae9f9d31361ed5d94a93ab2ef3a44ad5089ffbe0856ffc8d03f912b9c0e637c35361ab68a0d305b356d14871fa4e8af2754306d2e4a
|
7
|
+
data.tar.gz: 24602a71a6d55f9406e1f481a47544612eb77e3601688a8783b504ff168c1ee056375def2499f4596e7368a3296af7da3c83a13a6da85f2866525f583ad13e4c
|
data/lib/dnslookup.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require 'optparse'
|
2
2
|
|
3
|
+
# DNSLookup is the main class.
|
3
4
|
class DNSLookup
|
5
|
+
|
6
|
+
# Initializes the core variables and calls the driver methods.
|
4
7
|
def initialize
|
5
8
|
@type = ''
|
6
9
|
|
@@ -8,9 +11,10 @@ class DNSLookup
|
|
8
11
|
@domain = ARGV.shift
|
9
12
|
|
10
13
|
setup_query_servers
|
11
|
-
|
14
|
+
query_with_options
|
12
15
|
end
|
13
16
|
|
17
|
+
# Parses the options passed from command prompt.
|
14
18
|
def parse_options
|
15
19
|
OptionParser.new do |opt|
|
16
20
|
opt.banner = "Usage: dnslookup <domain name> [options]"
|
@@ -31,10 +35,6 @@ class DNSLookup
|
|
31
35
|
@type = 'txt'
|
32
36
|
end
|
33
37
|
|
34
|
-
opt.on("-i", "--internal", "Uses internal data center servers") do |v|
|
35
|
-
@internal = true
|
36
|
-
end
|
37
|
-
|
38
38
|
opt.on("-s", "--server=SERVER", "Specify specific name server to query") do |v|
|
39
39
|
@single_server = v
|
40
40
|
end
|
@@ -46,6 +46,7 @@ class DNSLookup
|
|
46
46
|
end.parse!
|
47
47
|
end
|
48
48
|
|
49
|
+
# Sets up the DNS servers to query.
|
49
50
|
def setup_query_servers
|
50
51
|
@servers = []
|
51
52
|
|
@@ -56,7 +57,8 @@ class DNSLookup
|
|
56
57
|
end
|
57
58
|
end
|
58
59
|
|
59
|
-
|
60
|
+
# Query name servers for specific records or entire zone if @type is blank or unknown.
|
61
|
+
def query_with_options
|
60
62
|
case @type
|
61
63
|
when 'mx'
|
62
64
|
query_command('mx')
|
@@ -71,6 +73,7 @@ class DNSLookup
|
|
71
73
|
end
|
72
74
|
end
|
73
75
|
|
76
|
+
# Query command to execute.
|
74
77
|
def query_command(type)
|
75
78
|
@servers.each do |server|
|
76
79
|
if type == 'any'
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dnslookup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor S. Keenan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: dnslookup is a DNS record query gem written in Ruby. dnslookup automatically
|
14
|
+
queries multiple public DNS servers or allows you to query a specific DNS server.
|
14
15
|
email: me@victorkeenan.com
|
15
16
|
executables:
|
16
17
|
- dnslookup
|
@@ -42,5 +43,5 @@ rubyforge_project:
|
|
42
43
|
rubygems_version: 2.6.1
|
43
44
|
signing_key:
|
44
45
|
specification_version: 4
|
45
|
-
summary:
|
46
|
+
summary: dnslookup is a DNS record query gem written in Ruby.
|
46
47
|
test_files: []
|