zone_name(String) — User assigned name for this resource. Must
be unique within the project. The name must be 1-32 characters long,
must begin with a letter, end with a letter or digit, and only
contain lowercase letters, digits or dashes.
zone_dns(String) — The DNS name of this managed zone, for
instance "example.com.".
description(String)(defaults to: nil)— A string of at most 1024 characters
associated with this resource for the user's convenience. Has no
effect on the managed zone's function.
name_server_set(String)(defaults to: nil)— A NameServerSet is a set of DNS name
servers that all host the same ManagedZones. Most users will leave
this field unset.
[[["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 - Class Google::Cloud::Dns::Project (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud-Dns-Project)\n- [1.0.0](/ruby/docs/reference/google-cloud-dns/1.0.0/Google-Cloud-Dns-Project)\n- [0.37.0](/ruby/docs/reference/google-cloud-dns/0.37.0/Google-Cloud-Dns-Project)\n- [0.36.1](/ruby/docs/reference/google-cloud-dns/0.36.1/Google-Cloud-Dns-Project)\n- [0.35.1](/ruby/docs/reference/google-cloud-dns/0.35.1/Google-Cloud-Dns-Project) \nReference documentation and code samples for the Cloud DNS API class Google::Cloud::Dns::Project.\n\nProject\n-------\n\nThe project is a top level container for resources including Cloud DNS\nManagedZones. Projects can be created only in the [Google Developers\nConsole](https://console.developers.google.com).\n\nSee [Google::Cloud#dns](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud#Google__Cloud_dns_instance_ \"Google::Cloud#dns (method)\") \n\nInherits\n--------\n\n- Object\n\nExample\n-------\n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzone = dns.zone \"example-com\"\nzone.records.each do |record|\n puts record.name\nend\n```\n\nMethods\n-------\n\n### #additions_per_change\n\n def additions_per_change()\n\nMaximum allowed number of records to add per change.\n\n### #create_zone\n\n def create_zone(zone_name, zone_dns, description: nil, name_server_set: nil) -\u003e Google::Cloud::Dns::Zone\n\nCreates a new zone. \n**Parameters**\n\n- **zone_name** (String) --- User assigned name for this resource. Must be unique within the project. The name must be 1-32 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes.\n- **zone_dns** (String) --- The DNS name of this managed zone, for instance \"example.com.\".\n- **description** (String) *(defaults to: nil)* --- A string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the managed zone's function.\n- **name_server_set** (String) *(defaults to: nil)* --- A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most users will leave this field unset. \n**Returns**\n\n- ([Google::Cloud::Dns::Zone](./Google-Cloud-Dns-Zone))\n**Example** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzone = dns.create_zone \"example-com\", \"example.com.\"\n```\n\n### #data_per_record\n\n def data_per_record()\n\nMaximum allowed number of data entries per record.\n\n### #deletions_per_change\n\n def deletions_per_change()\n\nMaximum allowed number of records to delete per change.\n\n### #find_zone\n\n def find_zone(zone_id) -\u003e Google::Cloud::Dns::Zone, nil\n\n**Alias Of** : [#zone](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_zone_instance_) \nRetrieves an existing zone by name or id. \n**Parameter**\n\n- **zone_id** (String, Integer) --- The name or id of a zone. \n**Returns**\n\n- ([Google::Cloud::Dns::Zone](./Google-Cloud-Dns-Zone), nil) --- Returns `nil` if the zone does not exist.\n**Example** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzone = dns.zone \"example-com\"\nputs zone.name\n```\n\n### #find_zones\n\n def find_zones(token: nil, max: nil) -\u003e Array\u003cGoogle::Cloud::Dns::Zone\u003e\n\n**Alias Of** : [#zones](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_zones_instance_) \nRetrieves the list of zones belonging to the project.\n\n\n\u003cbr /\u003e\n\n[Zone::List](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud-Dns-Zone-List \"Google::Cloud::Dns::Zone::List (class)\")) \n**Parameters**\n\n- **token** (String) *(defaults to: nil)* --- A previously-returned page token representing part of the larger set of results to view.\n- **max** (Integer) *(defaults to: nil)* --- Maximum number of zones to return. \n**Returns**\n\n- (Array\\\u003c[Google::Cloud::Dns::Zone](./Google-Cloud-Dns-Zone)\\\u003e) --- (See\n**Examples** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzones = dns.zones\nzones.each do |zone|\n puts zone.name\nend\n```\n\nRetrieve all zones: (See [Zone::List#all](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud-Dns-Zone-List#Google__Cloud__Dns__Zone__List_all_instance_ \"Google::Cloud::Dns::Zone::List#all (method)\")) \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzones = dns.zones\nzones.all do |zone|\n puts zone.name\nend\n```\n\n### #get_zone\n\n def get_zone(zone_id) -\u003e Google::Cloud::Dns::Zone, nil\n\n**Alias Of** : [#zone](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_zone_instance_) \nRetrieves an existing zone by name or id. \n**Parameter**\n\n- **zone_id** (String, Integer) --- The name or id of a zone. \n**Returns**\n\n- ([Google::Cloud::Dns::Zone](./Google-Cloud-Dns-Zone), nil) --- Returns `nil` if the zone does not exist.\n**Example** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzone = dns.zone \"example-com\"\nputs zone.name\n```\n\n### #id\n\n def id()\n\n**Alias Of** : [#project_id](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_project_id_instance_) \nThe unique ID string for the current project.\n**Example** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new(\n project_id: \"my-project\",\n credentials: \"/path/to/keyfile.json\"\n)\n\ndns.project_id #=\u003e \"my-project\"\n```\n\n### #number\n\n def number()\n\nThe project number.\n\n### #project\n\n def project()\n\n**Alias Of** : [#project_id](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_project_id_instance_) \nThe unique ID string for the current project.\n**Example** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new(\n project_id: \"my-project\",\n credentials: \"/path/to/keyfile.json\"\n)\n\ndns.project_id #=\u003e \"my-project\"\n```\n\n### #project_id\n\n def project_id()\n\n**Aliases**\n\n- [#project](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_project_instance_)\n- [#id](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_id_instance_) \nThe unique ID string for the current project.\n**Example** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new(\n project_id: \"my-project\",\n credentials: \"/path/to/keyfile.json\"\n)\n\ndns.project_id #=\u003e \"my-project\"\n```\n\n### #records_per_zone\n\n def records_per_zone()\n\nMaximum allowed number of records per zone in the project.\n\n### #refresh!\n\n def refresh!()\n\n**Alias Of** : [#reload!](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_reload!_instance_) \nReloads the change with updated status from the DNS service.\n\n### #reload!\n\n def reload!()\n\n**Aliases**\n\n- [#refresh!](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_refresh!_instance_) \nReloads the change with updated status from the DNS service.\n\n### #total_data_per_change\n\n def total_data_per_change()\n\nMaximum allowed total bytes size for all the data in one change.\n\n### #zone\n\n def zone(zone_id) -\u003e Google::Cloud::Dns::Zone, nil\n\n**Aliases**\n\n- [#find_zone](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_find_zone_instance_)\n- [#get_zone](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_get_zone_instance_) \nRetrieves an existing zone by name or id. \n**Parameter**\n\n- **zone_id** (String, Integer) --- The name or id of a zone. \n**Returns**\n\n- ([Google::Cloud::Dns::Zone](./Google-Cloud-Dns-Zone), nil) --- Returns `nil` if the zone does not exist.\n**Example** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzone = dns.zone \"example-com\"\nputs zone.name\n```\n\n### #zones\n\n def zones(token: nil, max: nil) -\u003e Array\u003cGoogle::Cloud::Dns::Zone\u003e\n\n**Aliases**\n\n- [#find_zones](./Google-Cloud-Dns-Project#Google__Cloud__Dns__Project_find_zones_instance_) \nRetrieves the list of zones belonging to the project.\n\n\n\u003cbr /\u003e\n\n[Zone::List](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud-Dns-Zone-List \"Google::Cloud::Dns::Zone::List (class)\")) \n**Parameters**\n\n- **token** (String) *(defaults to: nil)* --- A previously-returned page token representing part of the larger set of results to view.\n- **max** (Integer) *(defaults to: nil)* --- Maximum number of zones to return. \n**Returns**\n\n- (Array\\\u003c[Google::Cloud::Dns::Zone](./Google-Cloud-Dns-Zone)\\\u003e) --- (See\n**Examples** \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzones = dns.zones\nzones.each do |zone|\n puts zone.name\nend\n```\n\nRetrieve all zones: (See [Zone::List#all](/ruby/docs/reference/google-cloud-dns/latest/Google-Cloud-Dns-Zone-List#Google__Cloud__Dns__Zone__List_all_instance_ \"Google::Cloud::Dns::Zone::List#all (method)\")) \n\n```ruby\nrequire \"google/cloud/dns\"\n\ndns = Google::Cloud::Dns.new\nzones = dns.zones\nzones.all do |zone|\n puts zone.name\nend\n```\n\n### #zones_quota\n\n def zones_quota()\n\nMaximum allowed number of zones in the project."]]