- 2.52.0 (latest)
- 2.51.0
- 2.50.0
- 2.49.0
- 2.47.0
- 2.46.0
- 2.45.0
- 2.44.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.40.0
- 2.39.0
- 2.38.0
- 2.37.0
- 2.35.0
- 2.34.0
- 2.33.0
- 2.32.0
- 2.31.0
- 2.30.0
- 2.29.0
- 2.28.0
- 2.27.0
- 2.26.0
- 2.25.0
- 2.22.0
- 2.21.0
- 2.20.0
- 2.19.0
- 2.18.0
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.0
- 2.11.0
- 2.10.0
- 2.9.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.8
- 2.0.9
A client for Cloud DNS - A highly available global DNS network.
Here are two simple usage examples from within Compute/App Engine.
The first snippet shows how to create a zone resource. The complete source code can be found
on
CreateAndListZones.java. Note that you need to replace the domainName
with a domain
name that you own and the ownership of which you verified with Google.
Dns dns = DnsOptions.getDefaultInstance().getService();
String zoneName = "my-unique-zone";
String domainName = "someexampledomain.com.";
String description = "This is a google-cloud-dns sample zone.";
ZoneInfo zoneInfo = ZoneInfo.of(zoneName, domainName, description);
Zone createdZone = dns.create(zoneInfo);
The second example shows how to create records inside a zone. The complete code can be found on CreateAndListDnsRecords.java.
Dns dns = DnsOptions.getDefaultInstance().getService();
String zoneName = "my-unique-zone";
Zone zone = dns.getZone(zoneName);
String ip = "12.13.14.15";
RecordSet toCreate = RecordSet.newBuilder("www.someexampledomain.com.", RecordSet.Type.A)
.setTtl(24, TimeUnit.HOURS)
.addRecord(ip)
.build();
ChangeRequestInfo changeRequest = ChangeRequestInfo.newBuilder().add(toCreate).build();
zone.applyChangeRequest(changeRequest);
When using google-cloud from outside of App/Compute Engine, you have to specify a project ID and provide credentials. See Also: Google Cloud DNS
Classes
ChangeRequest
An immutable class representing an atomic update to a collection of RecordSets within a
Zone
.
See Also: Google Cloud DNS documentation
ChangeRequest.Builder
A builder for ChangeRequest
s.
ChangeRequestInfo
A class representing an atomic update to a collection of RecordSets within a
Zone
.
See Also: Google Cloud DNS documentation
ChangeRequestInfo.Builder
A builder for ChangeRequestInfo
.
ChangeRequestInfo.Status
This enumerates the possible states of a change request. See Also: Google Cloud DNS documentation
Dns.ChangeRequestListOption
Class for specifying change request listing options.
Dns.ChangeRequestOption
Class for specifying change request field options.
Dns.ProjectOption
Class for specifying project options.
Dns.RecordSetListOption
Class for specifying record set listing options.
Dns.ZoneListOption
Class for specifying zone listing options.
Dns.ZoneOption
Class for specifying zone field options.
DnsBatch
A batch of operations to be submitted to Google Cloud DNS using a single RPC request.
DnsOptions
DnsOptions.Builder
DnsOptions.DefaultDnsFactory
DnsOptions.DefaultDnsRpcFactory
ProjectInfo
The class provides the Google Cloud DNS information associated with this project. A project is a
top level container for resources including Zone
s. Projects can be created only in the
APIs console.
See Also: Google Cloud DNS documentation
ProjectInfo.Quota
This class represents quotas assigned to the ProjectInfo
.
See Also: Google Cloud DNS documentation
RecordSet
A class that represents a Google Cloud DNS record set.
A RecordSet
is the unit of data that will be returned by the DNS servers upon a DNS
request for a specific domain. The RecordSet
holds the current state of the DNS records
that make up a zone. You can read the records but you cannot modify them directly. Rather, you
edit the records in a zone by creating a ChangeRequest.
See Also: Google Cloud DNS documentation
RecordSet.Builder
A builder for RecordSet.
RecordSet.Type
Enum for the DNS record types supported by Cloud DNS.
Google Cloud DNS currently supports records of type A, AAAA, CAA, CNAME, MX NAPTR, NS, PTR, SOA, SPF, SRV, TXT. See Also: Cloud DNS supported record types
Zone
A Google Cloud DNS Zone object.
A zone is the container for all of your record sets that share the same DNS name prefix, for example, example.com. Zones are automatically assigned a set of name servers when they are created to handle responding to DNS queries for that zone. A zone has quotas for the number of record sets that it can include. See Also: Google Cloud DNS managed zone documentation
Zone.Builder
Builder for Zone
.
ZoneInfo
A Zone
represents a DNS zone hosted by the Google Cloud DNS service. A zone is a subtree
of the DNS namespace under one administrative responsibility. See Google Cloud DNS documentation for
more information.
ZoneInfo.Builder
Builder for ZoneInfo
.
ZoneInfo.DnsSecConfig
This class represents the DNSSEC configuration.
ZoneInfo.DnsSecConfig.Builder
ZoneInfo.KeySpec
This class represents the DNS key spec.
ZoneInfo.KeySpec.Builder
Interfaces
Dns
An interface for the Google Cloud DNS service. See Also: Google Cloud DNS
DnsFactory
An interface for Dns factories.
Enums
Dns.ChangeRequestField
The fields of a change request.
These values can be used to specify the fields to include in a partial response when calling Dns#applyChangeRequest(String, ChangeRequestInfo, ChangeRequestOption...) The ID is always returned even if not selected.
Dns.ProjectField
The fields of a project.
These values can be used to specify the fields to include in a partial response when calling Dns#getProject(ProjectOption...). Project ID is always returned, even if not specified.
Dns.RecordSetField
The fields of a record set.
These values can be used to specify the fields to include in a partial response when calling Dns#listRecordSets(String, RecordSetListOption...). The name and type are always returned even if not selected.
Dns.SortingOrder
The sorting order for listing.
Dns.ZoneField
The fields of a zone.
These values can be used to specify the fields to include in a partial response when calling Dns#getZone(String, ZoneOption...). The name is always returned, even if not specified.
Exceptions
DnsBatchResult<T>
This class holds a single result of a batch call to the Cloud DNS.
DnsException
DNS service exception.