Reference documentation and code samples for the google-cloud-dns class Google::Cloud::Dns::Record.
DNS Record
Represents a set of DNS resource records (RRs) for a given
#name and #type
in a Zone. Since it is a value object, a newly
created Record instance is transient until it is added to a Zone with
Zone#update. Note that
Zone#add and the Zone#update
block parameter can be used instead of Zone#record
or Record.new
to create new records.
Inherits
- Object
Example
require "google/cloud/dns" dns = Google::Cloud::Dns.new zone = dns.zone "example-com" zone.records.count #=> 2 record = zone.record "example.com.", "A", 86400, "1.2.3.4" zone.records.count #=> 2 change = zone.update record zone.records.count #=> 3
Methods
#data
def data() -> Array<String>
The array of resource record data, as determined by type
and defined
in RFC 1035 (section
5) and RFC 1034
(section 3.6.1).
For example: ["10 mail.example.com.", "20 mail2.example.com."].
- (Array<String>)
#data=
def data=(value) -> Array<String>
The array of resource record data, as determined by type
and defined
in RFC 1035 (section
5) and RFC 1034
(section 3.6.1).
For example: ["10 mail.example.com.", "20 mail2.example.com."].
- value (Array<String>)
- (Array<String>)
#dup
def dup()
Returns a deep copy of the record. Useful for updating records, since the original, unmodified record must be passed for deletion when using Zone#update.
#initialize
def initialize(name, type, ttl, data) -> Record
Creates a Record value object.
-
name (String) — The owner of the record. For example:
example.com.
. -
type (String) — The identifier of a supported record
type.
For example:
A
,AAAA
,CNAME
,MX
, orTXT
. - ttl (Integer) — The number of seconds that the record can be cached by resolvers.
-
data (String, Array<String>) — The resource record data, as
determined by
type
and defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). For example: ["10 mail.example.com.", "20 mail2.example.com."].
- (Record) — a new instance of Record
- (ArgumentError)
#name
def name() -> String
The owner of the record. For example: example.com.
.
- (String)
#name=
def name=(value) -> String
The owner of the record. For example: example.com.
.
- value (String)
- (String)
#ttl
def ttl() -> Integer
The number of seconds that the record can be cached by resolvers.
- (Integer)
#ttl=
def ttl=(value) -> Integer
The number of seconds that the record can be cached by resolvers.
- value (Integer)
- (Integer)
#type
def type() -> String
The identifier of a supported record type
.
For example: A
, AAAA
, CNAME
, MX
, or TXT
.
- (String)
#type=
def type=(value) -> String
The identifier of a supported record type
.
For example: A
, AAAA
, CNAME
, MX
, or TXT
.
- value (String)
- (String)