Parent

Net::DNS::RR::A

IPv4 Address Record (A)

Class for DNS IPv4 Address (A) resource records.

The resource data is an IPv4 (i.e. 32 bit long) address, hold in the instance variable address.

a = Net::DNS::RR::A.new("localhost.movie.edu. 360 IN A 127.0.0.1")

a = Net::DNS::RR::A.new(:name    => "localhost.movie.edu.",
                        :ttl     => 360,
                        :cls     => Net::DNS::IN,
                        :type    => Net::DNS::A,
                        :address => "127.0.0.1" )

When computing binary data to transmit the RR, the RDATA section is an Internet address expressed as four decimal numbers separated by dots without any embedded space (e.g. "10.2.0.52" or "192.0.5.6").

Public Instance Methods

address() click to toggle source

Gets the current IPv4 address for this record.

Returns an instance of IPAddr.

# File lib/net/dns/rr/a.rb, line 30
def address
  @address
end
address=(string_or_ipaddr) click to toggle source

Assigns a new IPv4 address to this record, which can be in the form of a String or an IPAddr object.

Examples

a.address = "192.168.0.1"
a.address = IPAddr.new("10.0.0.1")

Returns the new allocated instance of IPAddr.

# File lib/net/dns/rr/a.rb, line 43
def address=(string_or_ipaddr)
  @address = check_address(string_or_ipaddr)
  build_pack
  @address
end
value() click to toggle source

Gets the standardized value for this record, represented by the value of address.

Returns a String.

# File lib/net/dns/rr/a.rb, line 53
def value
  address.to_s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.