class Ronin::CLI::Commands::Dns

Queries DNS records for the given host name.

## Usage

ronin dns [options] {HOST ... | --file FILE}

## Options

-f, --file FILE                  Optional file to read values from
-N, --nameserver IP              Send DNS queries to the nameserver
-t A|AAAA|ANY|CNAME|HINFO|LOC|MINFO|MX|NS|PTR|SOA|SRV|TXT|WKS,
    --type                       Queries a specific type of DNS record
-h, --help                       Print help information

## Arguments

HOST                             The host name to query

Public Instance Methods

process_value(host) click to toggle source

Queries the given host.

@param [String] host

# File lib/ronin/cli/commands/dns.rb, line 69
def process_value(host)
  print_records(query_records(host))
end
query_records(host) click to toggle source

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.
# File lib/ronin/cli/commands/dns.rb, line 82
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