dnslookup 0.2.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a19d9fbc3a55a3817461a6fb42356fb983c3c8d4409fc3b06539c78e644117c6
4
- data.tar.gz: 4e5d9c585eb57936e0f7d93b47cfec771c9b00cd5921098af69811d7c0236ff5
3
+ metadata.gz: e0d06c69c8b59a03c0364decfbc5c00074d8e82c5afff6c7545d0197d644be2b
4
+ data.tar.gz: 48d9dada4cdeb4942575d84ebe08479604696441023cf89da16c3f4ffaadf6a7
5
5
  SHA512:
6
- metadata.gz: d7d006b4306b0bdacf41ffdebcc878c8d8fac2d72d4df6769e1f9010b87996f2b5179105a5116a2a58ed11f6cf74ce5f58ffbbc828971a8c4cdd860ddd7d8ef7
7
- data.tar.gz: 219c16da76a578bb236985cf4e83383cd9b15c960de105d771818e30b45d34ebf240916150e5f92773cc9480ee142e15d813ad3776376c78c531171837497859
6
+ metadata.gz: 59fe0315a56859625de4c1b478c9ffee7196b00fc85e41e7880c36f55ce6ef780c086959cab958a92b275996443198463656d331ea58d1a128d607d4ce3b8ad4
7
+ data.tar.gz: d8c44bc8ffea2304b420bbefe0a62e35daf947a0ca5065b80f33f759754456d1d32f49031e3b5800828dc550a981c4df71f45f6e7618c4b7070c92441b6fd72c
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DNSLookup
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/dnslookup.rb CHANGED
@@ -13,6 +13,12 @@ module DNSLookup
13
13
  @single_server = nil
14
14
  @domain = ARGV.shift
15
15
 
16
+ if @domain.nil? || @domain.start_with?('-')
17
+ puts "Error: You must specify a domain name.\n\n"
18
+ puts "Usage: dnslookup <domain name> [options]"
19
+ exit 1
20
+ end
21
+
16
22
  parse_options
17
23
  setup_query_servers
18
24
  query_with_options
@@ -20,7 +26,10 @@ module DNSLookup
20
26
 
21
27
  def parse_options
22
28
  OptionParser.new do |opt|
23
- opt.banner = "Usage: dnslookup <domain name> [options]"
29
+ opt.banner = <<~BANNER
30
+ Usage: dnslookup <domain name> [options]
31
+ Example: dnslookup example.com -a -m -s8.8.8.8
32
+ BANNER
24
33
  opt.on("-m", "--mx", "Return MX records") { @type << 'mx' }
25
34
  opt.on("-a", "--aname", "Return A name records") { @type << 'a' }
26
35
  opt.on("-c", "--cname", "Return C name records") { @type << 'c' }
@@ -28,6 +37,7 @@ module DNSLookup
28
37
  opt.on("-s", "--server=SERVER", "Specify specific name server to query") do |v|
29
38
  @single_server = v
30
39
  end
40
+ opt.on("-A", "--all", "Return all record types") { @type = %w[a mx c txt] }
31
41
  opt.on("-h", "--help", "Prints this help") do
32
42
  puts opt
33
43
  exit
@@ -57,22 +67,14 @@ module DNSLookup
57
67
  end
58
68
  end
59
69
 
60
- def query_command(type)
70
+ def query_command(types)
61
71
  @servers.each do |server|
62
- if type == 'any'
63
- check = `dig @#{server} #{type} #{@domain}`
64
-
65
- puts "Checking servers: #{server} root domain records"
66
- puts check
72
+ Array(types).each do |type|
73
+ record_type = type == 'any' ? '' : type.upcase
74
+ check = `dig @#{server} #{@domain} #{record_type} +short`
75
+ puts "Checking server: #{server} for #{record_type.empty? ? 'ALL' : record_type} records"
76
+ puts check.empty? ? "(no records found)" : check
67
77
  puts
68
- else
69
- @type.each do |type|
70
- check = `dig @#{server} #{@domain} #{type.upcase} +short`
71
-
72
- puts "Checking servers: #{server} for #{type.upcase} records"
73
- puts check
74
- puts
75
- end
76
78
  end
77
79
  end
78
80
  end
metadata CHANGED
@@ -1,29 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnslookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor S. Keenan
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-08 00:00:00.000000000 Z
10
+ date: 2025-06-12 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description: dnslookup is a DNS record query CLI gem written in Ruby. dnslookup automatically
14
- queries multiple public DNS servers or allows you to query a specific DNS server.
15
- email: me@victorkeenan.com
16
- executables:
17
- - dnslookup
12
+ description: A Ruby CLI tool to query DNS records from multiple public or custom name
13
+ servers, providing fast and flexible DNS lookups.
14
+ email:
15
+ - me@victorkeenan.com
16
+ executables: []
18
17
  extensions: []
19
18
  extra_rdoc_files: []
20
19
  files:
21
- - CHANGELOG.md
22
- - CODE_OF_CONDUCT.md
23
- - LICENSE.txt
24
- - README.md
25
- - bin/dnslookup
26
- - dnslookup.gemspec
27
20
  - lib/dnslookup.rb
28
21
  - lib/dnslookup/version.rb
29
22
  homepage: https://www.victorkeenan.com/projects/dnslookup/
@@ -31,12 +24,11 @@ licenses:
31
24
  - MIT
32
25
  metadata:
33
26
  homepage_uri: https://www.victorkeenan.com/projects/dnslookup/
34
- bug_tracker_uri: https://github.com/VictorSK/dnslookup/issues/
27
+ source_code_uri: https://github.com/VictorSK/dnslookup/
35
28
  changelog_uri: https://github.com/VictorSK/dnslookup/blob/main/CHANGELOG.md
29
+ bug_tracker_uri: https://github.com/VictorSK/dnslookup/issues/
36
30
  documentation_uri: https://github.com/VictorSK/dnslookup/blob/main/README.md
37
- source_code_uri: https://github.com/VictorSK/dnslookup/
38
31
  rubygems_mfa_required: 'true'
39
- post_install_message:
40
32
  rdoc_options: []
41
33
  require_paths:
42
34
  - lib
@@ -51,8 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
43
  - !ruby/object:Gem::Version
52
44
  version: '0'
53
45
  requirements: []
54
- rubygems_version: 3.5.5
55
- signing_key:
46
+ rubygems_version: 3.6.3
56
47
  specification_version: 4
57
- summary: DNS record query CLI gem written in Ruby.
48
+ summary: A simple Ruby CLI tool for querying DNS records.
58
49
  test_files: []
data/CHANGELOG.md DELETED
@@ -1,24 +0,0 @@
1
- # CHANGELOG
2
-
3
- The noteworthy updates for each dnslookup version are included here. For a complete changelog, see the git history.
4
-
5
- ## [0.2.0] - February 08, 2023
6
-
7
- ### New Features
8
-
9
- - Added ability to check multiple record types at once.
10
- - Updated core gem Ruby code and general code improvements.
11
- - Updated tests.
12
-
13
- ## [0.1.6] - February 06, 2023
14
-
15
- ### Changes
16
-
17
- - Added Ruby 3.0 to required versions.
18
- - Spec bumps and general code improvements.
19
-
20
- ## [0.1.0] - February 01, 2016
21
-
22
- ### New Features
23
-
24
- - Initial release
data/CODE_OF_CONDUCT.md DELETED
@@ -1,46 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- ## Our Standards
8
-
9
- Examples of behavior that contributes to creating a positive environment include:
10
-
11
- - Using welcoming and inclusive language
12
- - Being respectful of differing viewpoints and experiences
13
- - Gracefully accepting constructive criticism
14
- - Focusing on what is best for the community
15
- - Showing empathy towards other community members
16
-
17
- Examples of unacceptable behavior by participants include:
18
-
19
- - The use of sexualized language or imagery and unwelcome sexual attention or advances
20
- - Trolling, insulting/derogatory comments, and personal or political attacks
21
- - Public or private harassment
22
- - Publishing others' private information, such as a physical or electronic address, without explicit permission
23
- - Other conduct which could reasonably be considered inappropriate in a professional setting
24
-
25
- ## Our Responsibilities
26
-
27
- Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
-
29
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
-
31
- ## Scope
32
-
33
- This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
-
35
- ## Enforcement
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the main project maintainer [Victor S. Keenan](https://twitter.com/victorsk). The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
-
39
- Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
-
41
- ## Attribution
42
-
43
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
-
45
- [homepage]: http://contributor-covenant.org
46
- [version]: http://contributor-covenant.org/version/1/4/
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2016 - 2024 Victor S. Keenan
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
data/README.md DELETED
@@ -1,67 +0,0 @@
1
- # dnslookup
2
-
3
- [![Gem Version](https://badge.fury.io/rb/dnslookup.svg)](https://badge.fury.io/rb/dnslookup)
4
-
5
- dnslookup is a DNS record query CLI gem written in Ruby. dnslookup automatically queries multiple public DNS servers or allows you to query a specific DNS server.
6
-
7
- Please use [GitHub Issues](https://github.com/VictorSK/dnslookup/issues) to report bugs.
8
-
9
- ## Installation
10
-
11
- To add dnslookup to an existing project, add this line to your projects's Gemfile:
12
-
13
- ```ruby
14
- gem 'dnslookup'
15
- ```
16
-
17
- And then execute:
18
-
19
- ```bash
20
- bundle install
21
- ```
22
-
23
- Or to install locally:
24
-
25
- ```bash
26
- gem install dnslookup
27
- ```
28
-
29
- ## Usage
30
-
31
- Lookup DNS records:
32
-
33
- ```bash
34
- dnslookup <domain name> [options]
35
- ```
36
-
37
- ### Options
38
-
39
- `-m` or `--mx` will return only MX records.
40
-
41
- `-a` or `--aname` will return only A name records.
42
-
43
- `-c` or `--cname` will return only C name records.
44
-
45
- `-t` or `--txt` will return only TXT records.
46
-
47
- `-s` or `--server=IP` will query specific name server IP.
48
-
49
- `-h` or `--help` will output this help in your shell.
50
-
51
- Help with usage and options:
52
-
53
- ```bash
54
- dnslookup -h
55
- ```
56
-
57
- ## Contributing
58
-
59
- Bug reports and pull requests are welcome on [GitHub](https://github.com/VictorSK/dnslookup). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the terms specified in the [CODE OF CONDUCT](CODE_OF_CONDUCT). It's code, lets be safe and have fun!
60
-
61
- ## License
62
-
63
- dnslookup is copyright © 2016-2024 Victor S. Keenan. It is free software and may be redistributed under the terms specified in the [LICENSE](LICENSE) file.
64
-
65
- ## Coded With Love
66
-
67
- Coded crafted by me, [Victor S. Keenan](https://www.victorkeenan.com). Find me on Twitter [@VictorSK](https://twitter.com/victorsk) or [hire me](https://www.inspyre.com) to design, develop, and grow your product or service.
data/bin/dnslookup DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'dnslookup'
4
-
5
- DNSLookup::Query.new
data/dnslookup.gemspec DELETED
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/dnslookup/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'dnslookup'
7
- spec.version = DNSLookup::VERSION
8
- spec.author = 'Victor S. Keenan'
9
- spec.email = 'me@victorkeenan.com'
10
- spec.summary = "DNS record query CLI gem written in Ruby."
11
- spec.homepage = 'https://www.victorkeenan.com/projects/dnslookup/'
12
- spec.required_ruby_version = '>= 3.0'
13
- spec.license = 'MIT'
14
- spec.description = "dnslookup is a DNS record query CLI gem written in Ruby. dnslookup automatically queries multiple public DNS servers or allows you to query a specific DNS server."
15
- spec.executables = 'dnslookup'
16
- spec.require_paths = ["lib"]
17
- spec.metadata = {
18
- 'homepage_uri' => 'https://www.victorkeenan.com/projects/dnslookup/',
19
- 'bug_tracker_uri' => 'https://github.com/VictorSK/dnslookup/issues/',
20
- 'changelog_uri' => 'https://github.com/VictorSK/dnslookup/blob/main/CHANGELOG.md',
21
- 'documentation_uri' => 'https://github.com/VictorSK/dnslookup/blob/main/README.md',
22
- 'source_code_uri' => 'https://github.com/VictorSK/dnslookup/',
23
- 'rubygems_mfa_required' => 'true'
24
- }
25
- spec.files = Dir.chdir(__dir__) do
26
- `git ls-files -z`.split("\x0").reject do |f|
27
- (File.expand_path(f) == __FILE__) ||
28
- f.start_with?(*%w[bin/ test/ .git Rakefile Gemfile])
29
- end
30
- end
31
- end