Class: DHCP::DomainNameServerOption

Inherits:
Option
  • Object
show all
Defined in:
lib/net/dhcp/options.rb

Overview

The domain name server option specifies a list of Domain Name System (STD 13, RFC 1035 [8]) name servers available to the client. Servers SHOULD be listed in order of preference.

The code for the domain name server option is 6. The minimum length for this option is 4 octets, and the length MUST always be a multiple of 4.

The default value for this option is 0.0.0.0

Instance Attribute Summary

Attributes inherited from Option

#len, #payload, #type

Instance Method Summary collapse

Methods inherited from Option

#eql?, #pack, #to_a

Constructor Details

#initialize(params = {}) ⇒ DomainNameServerOption

Returns a new instance of DomainNameServerOption.



126
127
128
129
130
# File 'lib/net/dhcp/options.rb', line 126

def initialize(params={})
  params[:type] = $DHCP_DNS
  params[:payload] = params.fetch(:payload, [0, 0, 0, 0])
  super(params)
end

Instance Method Details

#to_sObject



132
133
134
# File 'lib/net/dhcp/options.rb', line 132

def to_s()
  "Domain Name Server = #{self.payload.join('.')}"
end