Skip to content

Commit

Permalink
Add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Oct 11, 2023
1 parent 8d74132 commit b89d779
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/rex/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ def self.gethostbyname(host)
@@resolver ? self.rex_gethostbyname(host) : ::Socket.gethostbyname(host)
end

#
# Wrapper for Resolv::DNS.getresources which normalizes the return value to a
# list of hostnames regardless of the resource class.
#
# @param name [String] The name to lookup.
# @param typeclass [Symbol] The resource class to lookup, e.g. CNAME, MX, etc.
# @raises ArgumentError An argument error is raised when the typeclass is invalid.
# @return [Array<String>] The hostnames that were returned by the query.
def self.getresources(name, typeclass)
return self.rex_getresources(name, typeclass) if @@resolver

Expand Down

0 comments on commit b89d779

Please sign in to comment.