Class: Resolv::MDNS (Ruby 2.2.2)
Description: Class : Resolv::MDNS - Ruby 2.2.2

- Home
- Core 2.2.2
- Std-lib 2.2.2
- Downloads

Support for the Ruby 2.2 series has ended. See here for reference.

### Home Classes Methods

### In Files

- resolv.rb

### Parent

Resolv::DNS

### Methods

- ::new
- #each_address

### Class/Module Index

Quicksearch

- Resolv
- Resolv::DNS
- Resolv::DNS::Config
- Resolv::DNS::Config::NXDomain
- Resolv::DNS::Config::OtherResolvError
- Resolv::DNS::DecodeError
- Resolv::DNS::EncodeError
- Resolv::DNS::Name
- Resolv::DNS::Query
- Resolv::DNS::Requester
- Resolv::DNS::Requester::RequestError
- Resolv::DNS::Resource
- Resolv::DNS::Resource::ANY
- Resolv::DNS::Resource::CNAME
- Resolv::DNS::Resource::DomainName
- Resolv::DNS::Resource::Generic
- Resolv::DNS::Resource::HINFO
- Resolv::DNS::Resource::IN
- Resolv::DNS::Resource::IN::A
- Resolv::DNS::Resource::IN::AAAA
- Resolv::DNS::Resource::IN::SRV
- Resolv::DNS::Resource::IN::WKS
- Resolv::DNS::Resource::LOC
- Resolv::DNS::Resource::MINFO
- Resolv::DNS::Resource::MX
- Resolv::DNS::Resource::NS
- Resolv::DNS::Resource::PTR
- Resolv::DNS::Resource::SOA
- Resolv::DNS::Resource::TXT
- Resolv::Hosts
- Resolv::IPv4
- Resolv::IPv6
- Resolv::LOC
- Resolv::LOC::Alt
- Resolv::LOC::Coord
- Resolv::LOC::Size
- Resolv::MDNS
- Resolv::ResolvError
- Resolv::ResolvTimeout

No matching classes.

# Resolv::MDNS

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

AddressV4

  Default IPv4 mDNS address

AddressV6

  Default IPv6 mDNS address

Addresses

  Default mDNS addresses

Port

  Default mDNS Port

### 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 Resolv::DNS#initialize.

                   # File resolv.rb, line 2569
    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 Resolv::DNS::Name or a String. Retrieved addresses will be a Resolv::IPv4 or Resolv::IPv6

                   # File resolv.rb, line 2585
    def each_address(name)
      name = Resolv::DNS::Name.create(name)

      return unless name.to_a.last == 'local'

      super(name)
    end