Reference documentation and code samples for the Cloud DNS API module Google::Cloud::Dns.
Google Cloud DNS
Google Cloud DNS is a high-performance, resilient, global DNS service that
provides a cost-effective way to make your applications and services
available to your users. This programmable, authoritative DNS service can
be used to easily publish and manage DNS records using the same
infrastructure relied upon by Google. To learn more, readWhat is Google
Cloud DNS?.
The following DNS configuration parameters are supported:
project_id- (String) Identifier for a DNS project. (The
parameterprojectis considered deprecated, but may also be used.)
credentials- (String, Hash, Google::Auth::Credentials) The path to
the keyfile as a String, the contents of the keyfile as a Hash, or a
Google::Auth::Credentials object. (SeeCredentials) (The
parameterkeyfileis considered deprecated, but may also be used.)
scope- (String, Array
retries- (Integer) Number of times to retry requests on server
error.
timeout- (Integer) Default timeout to use in requests.
endpoint- (String) Override of the endpoint host name, ornilto use the default endpoint.
Yields
(Google::Cloud.configure.dns)
Returns
(Google::Cloud::Config) — The configuration object the
Google::Cloud::Dns library uses.
project_id(String)(defaults to: nil)— Identifier for a DNS project. If not present,
the default project for the credentials is used.
credentials(String, Hash, Google::Auth::Credentials)(defaults to: nil)— The path to
the keyfile as a String, the contents of the keyfile as a Hash, or a
Google::Auth::Credentials object. (SeeCredentials)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud DNS API - Module Google::Cloud::Dns (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud-Dns)\n- [1.0.0](/ruby/docs/reference/google-cloud-dns/1.0.0/Google-Cloud-Dns)\n- [0.37.0](/ruby/docs/reference/google-cloud-dns/0.37.0/Google-Cloud-Dns)\n- [0.36.1](/ruby/docs/reference/google-cloud-dns/0.36.1/Google-Cloud-Dns)\n- [0.35.1](/ruby/docs/reference/google-cloud-dns/0.35.1/Google-Cloud-Dns) \nReference documentation and code samples for the Cloud DNS API module Google::Cloud::Dns.\n\nGoogle Cloud DNS\n----------------\n\nGoogle Cloud DNS is a high-performance, resilient, global DNS service that\nprovides a cost-effective way to make your applications and services\navailable to your users. This programmable, authoritative DNS service can\nbe used to easily publish and manage DNS records using the same\ninfrastructure relied upon by Google. To learn more, read [What is Google\nCloud DNS?](https://cloud.google.com/dns/what-is-cloud-dns).\n\nSee [Google Cloud DNS Overview](./index.html \"Google Cloud DNS Overview\").\n\nMethods\n-------\n\n### .configure\n\n def self.configure() -\u003e Google::Cloud::Config\n\nConfigure the Google Cloud DNS library.\n\nThe following DNS configuration parameters are supported:\n\n- `project_id` - (String) Identifier for a DNS project. (The parameter `project` is considered deprecated, but may also be used.)\n- `credentials` - (String, Hash, Google::Auth::Credentials) The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object. (See [Credentials](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud-Dns-Credentials \"Google::Cloud::Dns::Credentials (class)\")) (The parameter `keyfile` is considered deprecated, but may also be used.)\n- `scope` - (String, Array\n- `retries` - (Integer) Number of times to retry requests on server error.\n- `timeout` - (Integer) Default timeout to use in requests.\n- `endpoint` - (String) Override of the endpoint host name, or `nil` to use the default endpoint. \n**Yields**\n\n- (Google::Cloud.configure.dns) \n**Returns**\n\n- (Google::Cloud::Config) --- The configuration object the Google::Cloud::Dns library uses.\n\n### .new\n\n def self.new(project_id: nil, credentials: nil, scope: nil, retries: nil, timeout: nil, endpoint: nil, project: nil, keyfile: nil) -\u003e Google::Cloud::Dns::Project\n\nCreates a new `Project` instance connected to the DNS service.\nEach call creates a new connection.\n\n\n\u003cbr /\u003e\n\nFor more information on connecting to Google Cloud see the\n[Authentication Guide](./AUTHENTICATION \"Authentication Guide\"). \n**Parameters**\n\n- **project_id** (String) *(defaults to: nil)* --- Identifier for a DNS project. If not present, the default project for the credentials is used.\n- **credentials** (String, Hash, Google::Auth::Credentials) *(defaults to: nil)* --- The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object. (See [Credentials](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud-Dns-Credentials \"Google::Cloud::Dns::Credentials (class)\"))\n- **scope** (String, Array\\\u003cString\\\u003e) *(defaults to: nil)* ---\n\n The OAuth 2.0 scopes controlling\n the set of resources and operations that the connection can access.\n See [Using OAuth 2.0 to Access Google\n APIs](https://developers.google.com/identity/protocols/OAuth2).\n\n The default scope is:\n - `https://www.googleapis.com/auth/ndev.clouddns.readwrite`\n- **retries** (Integer) *(defaults to: nil)* --- Number of times to retry requests on server error. The default value is `3`. Optional.\n- **timeout** (Integer) *(defaults to: nil)* --- Default timeout to use in requests. Optional.\n- **endpoint** (String) *(defaults to: nil)* --- Override of the endpoint host name. Optional. If the param is nil, uses the default endpoint.\n- **project** (String) *(defaults to: nil)* --- Alias for the `project_id` argument. Deprecated.\n- **keyfile** (String) *(defaults to: nil)* --- Alias for the `credentials` argument. Deprecated. \n**Returns**\n\n- ([Google::Cloud::Dns::Project](./Google-Cloud-Dns-Project)) \n**Raises**\n\n- (ArgumentError)\n**Example** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new(\n project_id: \"my-dns-project\",\n credentials: \"/path/to/keyfile.json\"\n )\n\nzone = dns.zone \"example-com\"\n```\n\nConstants\n---------\n\n### VERSION\n\n**value:**\"1.1.0\".freeze"]]