End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Resolv::DNS#each_name
each_name(address) { |name| ... }
lib/resolv.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/resolv.rb, line 448
def each_name(address)
case address
when Name
ptr = address
when IPv4, IPv6
ptr = address.to_name
when IPv4::Regex
ptr = IPv4.create(address).to_name
when IPv6::Regex
ptr = IPv6.create(address).to_name
else
raise ResolvError.new("cannot interpret as address: #{address}")
end
each_resource(ptr, Resource::IN::PTR) {|resource| yield resource.name}
end
Iterates over all hostnames for address retrieved from the DNS resolver.
address must be a Resolv::IPv4, Resolv::IPv6 or a String. Retrieved names will be Resolv::DNS::Name instances.
See also
#each_address
#each_resource
#close
#fetch_resource
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0