class Gem::Resolv::MDNS
Gem::Resolv::MDNS
is a one-shot Multicast DNS
(mDNS) resolver. It blindly makes queries to the mDNS addresses without understanding anything about multicast ports.
Information taken form the following places:
-
RFC 6762
Constants
Public Class Methods
new(config_info=nil)
click to toggle source
Creates a new one-shot Multicast DNS
(mDNS) resolver.
config_info
can be:
- nil
-
Uses the default mDNS addresses
- Hash
-
Must contain :nameserver or :nameserver_port like Gem::Resolv::DNS#initialize.
Calls superclass method
Gem::Resolv::DNS::new
# File rubygems/vendor/resolv/lib/resolv.rb, line 3173 def initialize(config_info=nil) if config_info then super({ nameserver_port: Addresses }.merge(config_info)) else super(nameserver_port: Addresses) end end
Public Instance Methods
each_address(name)
click to toggle source
Iterates over all IP addresses for name
retrieved from the mDNS resolver, provided name ends with “local”. If the name does not end in “local” no records will be returned.
name
can be a Gem::Resolv::DNS::Name
or a String. Retrieved addresses will be a Gem::Resolv::IPv4
or Gem::Resolv::IPv6
Calls superclass method
Gem::Resolv::DNS#each_address
# File rubygems/vendor/resolv/lib/resolv.rb, line 3189 def each_address(name) name = Gem::Resolv::DNS::Name.create(name) return unless name[-1].to_s == 'local' super(name) end