Class Net::DNS::RR::A
In: lib/net/dns/rr/a.rb
Parent: RR

Name

Net::DNS::RR::A DNS A resource record

Synopsis

require "net/dns/rr"

Description

Net::DNS::RR::A is the class to handle resource records of type A, the most common in a DNS query. Its 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 trasmit the RR, the RDATA section is an Internet address expressed as four decimal numbers separated by dots without any imbedded spaces (e.g.,"10.2.0.52" or "192.0.5.6").

Methods

address=  

Attributes

address  [R] 

Public Instance methods

Assign to the RR::A object a new IPv4 address, which can be in the form of a string or an IPAddr object

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

[Source]

# File lib/net/dns/rr/a.rb, line 44
        def address=(addr)
          @address = check_address addr
          build_pack
        end

[Validate]