This page shows the JSON formats for various Cloud DNS record types. To get started using Cloud DNS, see the Quickstart. To manage your DNS records, use the ResourceRecordSets API.
Supported DNS record types
Cloud DNS supports the following types of records:
Record type | Description |
---|---|
A |
Address record, which is used to map a host name to an IPv4 address. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "example.com.", "rrdatas": [ "1.2.3.4" ], "ttl": 86400, "type": "A" } |
AAAA |
IPv6 Address record, which is used to map a host name to an IPv6 address. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "example.com.", "rrdatas": [ "2607:f8b0:400a:801::1005" ], "ttl": 86400, "type": "AAAA" } |
CNAME |
Canonical name record, which is used to alias names. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "mail.example.com.", "rrdatas": [ "example.com." ], "ttl": 86400, "type": "CNAME" }
Note that the hostnames must end with periods or trailing dots
( |
MX |
Mail exchange record, which is used in routing requests to mail servers. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "example.com.", "rrdatas": [ "10 mail.example.com.", "20 mail2.example.com." ], "ttl": 86400, "type": "MX" }
Note that the hostnames must end with periods or trailing dots
( |
NAPTR |
Naming authority pointer record, defined by RFC 3403. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "2.1.2.1.5.5.5.0.7.7.1.e164.arpa.", "rrdatas": [ "100 10 \"u\" \"sip+E2U\" \"!^.*$!sip:information@foo.se!i\" .", "102 10 \"u\" \"smtp+E2U\" \"!^.*$!mailto:information@foo.se!i\" ." ], "ttl": 300, "type": "NAPTR" }
Note that the value in the final
This record type raises several escaping issues. Embedded quotes must
be escaped for use in JSON as demonstrated earlier. Also,
the { "kind": "dns#resourceRecordSet", "name": "cid.urn.arpa.", "rrdatas": [ "100 10 \"\" \"\" \"!^urn:cid:.+@([^\\\\.]+\\\\.)(.*)$!\\\\2!i\" ." ], "ttl": 300, "type": "NAPTR" } |
NS |
Name server record, which delegates a DNS zone to an authoritative server. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "example.com.", "rrdatas": [ "ns-cloud1.googledomains.com." ], "ttl": 86400, "type": "NS" }
Note that the hostnames must end with periods or trailing dots
( |
PTR |
Pointer record, which is often used for reverse DNS lookups. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "2.1.0.10.in-addr.arpa.", "rrdatas": [ "server.example.com." ], "ttl": 60, "type": "PTR" }
Creates a mapping from the address |
SOA |
Start of authority record, which specifies authoritative information
about a DNS zone. An Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "example.com.", "rrdatas": [ "ns-cloud1.googledomains.com. dns-admin.google.com. 1 21600 3600 1209600 300" ], "ttl": 21600, "type": "SOA" }
Note that the hostnames must end with periods or trailing dots
( |
SPF |
Sender policy framework record, which is used in email validation systems. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "example.com.", "rrdatas": [ "v=spf1 mx:example.com -all" ], "ttl": 21600, "type": "SPF" } |
SRV |
Service locator record, which is used by some voice over IP, instant messaging protocols, and other applications. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "sip.example.com.", "rrdatas": [ "0 5 5060 sip.example.com." ], "ttl": 21600, "type": "SRV" }
Note that the hostnames must end with periods or trailing dots
( |
TXT |
Text record, which can contain arbitrary text and can also be used to define machine-readable data, such as security or abuse prevention information. Example of the resource record set representation: { "kind": "dns#resourceRecordSet", "name": "example.com.", "rrdatas": [ "google-site-verification=xxxxxxxxxxxxYYYYYYXXX" ], "ttl": 21600, "type": "TXT" }
The { "kind": "dns#resourceRecordSet", "name": "example.com.", "rrdatas": [ "\"v=spf1 include:_spf.google.com ~all\"" ], "ttl": 21600, "type": "TXT" }
The preceding resource record set consists of a single
|
Wildcard DNS records
Wildcard records are supported for all record types, except for NS
records.
For example, you might want to map all subdomains to the IP address 1.2.3.4
with the following Change
request:
{ "additions": [ { "kind": "dns#resourceRecordSet", "name": "*.example.com.", "rrdatas": [ "1.2.3.4" ], "ttl": 21600, "type": "A" } ] }
What's next
- To learn how to use these formats, see Managing records.
- To see how these formats fit into the overall framework, see Cloud DNS overview.