0
0
GCPcloud~30 mins

Cloud DNS for domain management in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Cloud DNS for domain management
📖 Scenario: You are managing a website and want to use Google Cloud DNS to handle your domain's DNS records. This will help direct visitors to your website by translating your domain name into the correct IP address.
🎯 Goal: Create a Cloud DNS managed zone, add a DNS A record to point your domain to an IP address, and configure the TTL (time to live) for the record.
📋 What You'll Learn
Create a managed zone named example-zone with DNS name example.com.
Set the DNS zone description to Example domain zone.
Add an A record named www.example.com. pointing to IP 203.0.113.10.
Set the TTL for the A record to 300 seconds.
💡 Why This Matters
🌍 Real World
Managing DNS records is essential for directing internet traffic to your website or services. Cloud DNS helps automate and manage these records in the cloud.
💼 Career
Cloud engineers and DevOps professionals often configure DNS zones and records to ensure reliable domain name resolution for applications.
Progress0 / 4 steps
1
Create the managed zone dictionary
Create a dictionary called managed_zone with keys name, dns_name, and description. Set name to "example-zone", dns_name to "example.com.", and description to "Example domain zone".
GCP
Need a hint?

Use a Python dictionary with the exact keys and values as specified.

2
Create the DNS A record configuration
Create a dictionary called a_record with keys name, type, ttl, and rrdatas. Set name to "www.example.com.", type to "A", ttl to 300, and rrdatas to a list containing the string "203.0.113.10".
GCP
Need a hint?

Remember that rrdatas is a list of IP addresses as strings.

3
Combine managed zone and DNS record into a configuration
Create a dictionary called dns_config with keys managed_zone and records. Set managed_zone to the previously created managed_zone dictionary and records to a list containing the a_record dictionary.
GCP
Need a hint?

Use the existing variables to build the combined configuration dictionary.

4
Add the final Cloud DNS API request structure
Create a dictionary called cloud_dns_request with keys zone and changes. Set zone to the managed_zone dictionary. Set changes to a dictionary with key additions set to the list containing a_record.
GCP
Need a hint?

This structure matches the Cloud DNS API request format for adding records.