GCP Associate Cloud Engineer Practice Question 92: Cloud DNS Private Zone Selected VPCs
Google Cloud Associate Cloud Engineer · Test 10 · question 2 of 10
A company runs internal services on VM instances in two VPC networks, "prod-vpc" and "staging-vpc", both in the same project. You need to publish DNS records for internal.example.com that resolve only for clients inside prod-vpc. Clients in staging-vpc, and anyone outside Google Cloud, must not be able to resolve these records at all.
What should you do?
Show answer and explanation
Answer:
A Cloud DNS private managed zone is resolvable only from the VPC networks explicitly authorized for it. Authorizing just prod-vpc means only clients querying from that network can resolve records in the zone; staging-vpc and any client outside Google Cloud get no answer for the zone's records at all, which matches the requirement exactly.
Option B is wrong because a public managed zone is served on the public internet by Cloud DNS's public name servers, and there is no firewall rule that can restrict who queries a public DNS zone; firewall rules control network traffic to VM instances, not DNS resolution. Option C is wrong because authorizing both networks makes the zone resolvable from staging-vpc as well, and IAM deny policies control access to Google Cloud APIs and resources, not DNS query visibility, so it would not stop staging-vpc from resolving the records. Option D is wrong because a response policy changes how queries are answered within an authorized network; it does not create the scoped visibility described, and forwarding to an external server does not achieve the goal of authoritatively serving internal.example.com only to prod-vpc.
Reference: Create a private zone