Class: Resolv::DNS::Resource::IN::SRV (Ruby 2.4.2)
Description: Class : Resolv::DNS::Resource::IN::SRV - Ruby 2.4.2

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

### Home Classes Methods

### In Files

- resolv.rb

### Parent

Resolv::DNS::Resource

### Methods

- ::new

### 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::DNS::Resource::IN::SRV

`SRV` resource record defined in RFC 2782

These records identify the hostname and port that a service is available at.

### Constants

ClassValue
TypeValue

### Attributes

port[R]

The port on this target host of this service.

The range is 0-65535.

priority[R]

The priority of this target host.

`A` client MUST attempt to contact the target host with the lowest-numbered priority it can reach; target hosts with the same priority SHOULD be tried in an order defined by the weight field. The range is 0-65535. Note that it is not widely implemented and should be set to zero.

target[R]

The domain name of the target host.

`A` target of “.” means that the service is decidedly not available at this domain.

weight[R]

`A` server selection mechanism.

The weight field specifies a relative weight for entries with the same priority. Larger weights SHOULD be given a proportionately higher probability of being selected. The range of this number is 0-65535. Domain administrators SHOULD use Weight 0 when there isn't any server selection to do, to make the RR easier to read for humans (less noisy). Note that it is not widely implemented and should be set to zero.

### Public Class Methods

new(priority, weight, port, target) click to toggle source

Create a `SRV` resource record.

See the documentation for `priority`, `weight`, `port` and `target` for `priority`, `weight`, +port and `target` respectively.

                   # File resolv.rb, line 2251
    def initialize(priority, weight, port, target)
      @priority = priority.to_int
      @weight = weight.to_int
      @port = port.to_int
      @target = Name.create(target)
    end