Question

Difficulty: MediumManaging Networking Resources

An organization maintains a Cloud DNS private managed zone named `corp-internal-zone` that provides internal domain name resolution for workloads. The private zone is currently associated with a single Virtual Private Cloud (VPC) network named `vpc-analytics`. An operations engineer must extend DNS resolution for `corp-internal-zone` so that virtual machines in a second VPC network named `vpc-services` can also resolve these internal DNS records without removing access from `vpc-analytics`. Which `gcloud` command should the engineer run to accomplish this goal?

  1. gcloud dns managed-zones update corp-internal-zone --networks=vpc-analytics,vpc-servicesAnswer
  2. B
    gcloud dns managed-zones update corp-internal-zone --networks=vpc-services
  3. C
    gcloud compute networks subnets update vpc-services --add-dns-zone=corp-internal-zone
  4. D
    gcloud dns record-sets update corp-internal-zone --add-network=vpc-services

Answer

The command `gcloud dns managed-zones update corp-internal-zone --networks=vpc-analytics,vpc-services` is correct because updating a private Cloud DNS zone's authorized VPC networks replaces the existing list with the values supplied to the `--networks` flag.
Updating a Cloud DNS private zone to authorize multiple VPC networks requires passing a complete, comma-separated list of all VPC networks to the `--networks` flag of `gcloud dns managed-zones update`. Including both `vpc-analytics` and `vpc-services` ensures both networks maintain private DNS resolution.

Step-by-Step Solution

1
Identify the target resource and command group for managing Cloud DNS zone configurations.
Determined that private zone network bindings are updated using the `gcloud dns managed-zones update` command.
VPC network visibility is a property of the managed zone resource.
2
Determine the required behavior of the `--networks` flag during a zone update.
Recognized that the `--networks` flag replaces the entire list of authorized VPC networks rather than incrementally appending.
To preserve existing access for `vpc-analytics` while adding `vpc-services`, both networks must be explicitly listed as a comma-separated string.

Key Concept

Cloud DNS Private Zone VPC Network Binding Management
Rate this question