Turn a domain name into a working address with Cloud DNS: create a managed zone, add the record types that matter, update records in a transaction, and verify that they resolve.
DNS is the internet's phone book: it turns a name like example.com into a server's IP address. Cloud DNS hosts those records for you. Why: you use it to point your domain at your load balancer IP, storage site, or other endpoints.
List the DNS zones you already host
gcloud dns managed-zones listA managed zone holds all the records for one domain. Why: creating it gives you Google name servers; you set those at your domain registrar so the world asks Cloud DNS for your domain's answers.
Create a public managed zone for your domain
gcloud dns managed-zones create example-zone \
--dns-name example.com. \
--description "example.com records" \
--visibility publicShow the name servers to set at your registrar
gcloud dns managed-zones describe example-zone \
--format "value(nameServers)"A few record types cover most needs. A: name → IPv4 address. CNAME: name → another name. MX: where email goes. TXT: free-form text (used for domain verification). Why care: each points a different kind of traffic to the right place.
The quick way: add a single record set (www -> an IP, TTL 300)
gcloud dns record-sets create www.example.com. \
--zone example-zone --type A --ttl 300 \
--rrdatas 203.0.113.10For multiple edits, Cloud DNS uses a transaction: you start one, stage adds/removes, then execute them together. Why: all changes apply at once (atomically), so you never leave the zone half-updated if something fails midway.
Start a transaction, stage a TXT record, then commit it
gcloud dns record-sets transaction start --zone example-zonegcloud dns record-sets transaction add "verification=abc123" \
--zone example-zone --name example.com. --type TXT --ttl 300gcloud dns record-sets transaction execute --zone example-zoneAfter adding records, confirm they resolve. Why: DNS changes take time to propagate, and querying directly tells you whether the record is live before you point real traffic at it.
List the record sets in the zone
gcloud dns record-sets list --zone example-zoneAsk a public resolver directly
nslookup www.example.com 8.8.8.8