lib/ronin/cli/dns.rb in ronin-2.0.3 vs lib/ronin/cli/dns.rb in ronin-2.0.4
- old
+ new
@@ -22,10 +22,28 @@
class CLI
#
# Mixin for adding DNS support to commands.
#
module DNS
+ # Mapping of DNS record types and lowercase versions.
+ RECORD_TYPES = {
+ A: :a,
+ AAAA: :aaaa,
+ ANY: :any,
+ CNAME: :cname,
+ HINFO: :hinfo,
+ LOC: :loc,
+ MINFO: :minfo,
+ MX: :mx,
+ NS: :ns,
+ PTR: :ptr,
+ SOA: :soa,
+ SRV: :srv,
+ TXT: :txt,
+ WKS: :wks
+ }
+
#
# Adds the `-N,--nameserver HOST|IP` option to the command which is
# including {DNS}.
#
# @param [Class<Command>] command
@@ -68,26 +86,9 @@
nameservers: @nameservers
)
else
Support::Network::DNS.resolver
end
- end
-
- #
- # Queries the records for the given host name.
- #
- # @param [String] host
- # The host name to query.
- #
- # @return [Array<Resolv::DNS::Resource>]
- # The returned DNS resource records.
- #
- def query_records(host)
- if options[:type]
- resolver.get_records(host,options[:type].downcase)
- else
- resolver.get_a_records(host) + resolver.get_aaaa_records(host)
- end
end
#
# Prints multiple DNS records.
#