You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Cloud DNS is Google Cloud's managed, authoritative DNS service. It translates domain names into IP addresses with high availability, low latency, and a 100% uptime SLA. Cloud DNS supports both public zones (internet-facing) and private zones (internal to your VPC), making it the single DNS solution for all your GCP workloads.
Cloud DNS is a fully managed, authoritative DNS hosting service. You create DNS zones and records, and Google operates the global infrastructure to answer DNS queries. Key features:
A public zone hosts DNS records that are resolvable from the internet. When you register a domain (e.g. example.com), you create a public zone in Cloud DNS and update your domain registrar's nameservers to point to the Cloud DNS nameservers.
gcloud dns managed-zones create my-zone \
--dns-name="example.com." \
--description="Public zone for example.com" \
--visibility=public
gcloud dns record-sets create www.example.com. \
--zone=my-zone \
--type=A \
--ttl=300 \
--rrdatas="203.0.113.10"
After creating the zone, update your registrar to use the nameservers listed in the zone's NS record (e.g. ns-cloud-a1.googledomains.com).
A private zone provides DNS resolution only within linked VPC networks. Records in a private zone are not visible from the internet. This is ideal for:
db.internal.example.com)gcloud dns managed-zones create internal-zone \
--dns-name="internal.example.com." \
--description="Private zone for internal services" \
--visibility=private \
--networks=my-vpc
Only resources in the linked VPC (my-vpc) can resolve records in this zone.
DNS peering forwards DNS queries from one VPC to another VPC's DNS configuration. This is useful in hub-and-spoke architectures where a central VPC manages DNS:
gcloud dns managed-zones create peering-zone \
--dns-name="shared.example.com." \
--description="Peers to hub VPC DNS" \
--visibility=private \
--networks=spoke-vpc \
--target-network=hub-vpc
For hybrid environments (cloud + on-premises), you can configure DNS forwarding:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.