Bird
Raised Fist0
GCPcloud~10 mins

Custom domains in GCP - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a custom domain mapping in Google Cloud App Engine.

GCP
gcloud app domain-mappings create [1] --certificate-management=auto
Drag options to blanks, or click blank then click option'
Aexample.com
Bmyapp.appspot.com
Cdefault
Dappengine.google.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using the default appspot domain instead of a custom domain.
Using Google internal URLs instead of your domain.
2fill in blank
medium

Complete the code to verify domain ownership using Google Cloud CLI.

GCP
gcloud domains verify [1]
Drag options to blanks, or click blank then click option'
Adefault
Bproject-id
Cexample.com
Dappengine
Attempts:
3 left
💡 Hint
Common Mistakes
Using project ID or other unrelated strings instead of the domain name.
Trying to verify the default appspot domain.
3fill in blank
hard

Fix the error in the command to list domain mappings for your app.

GCP
gcloud app domain-mappings [1]
Drag options to blanks, or click blank then click option'
Ashow
Blist
Cdescribe
Dget
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' or 'describe' without specifying a domain.
Using 'get' which is not a valid subcommand here.
4fill in blank
hard

Fill both blanks to create a domain mapping with a specific SSL certificate.

GCP
gcloud app domain-mappings create [1] --certificate-id=[2]
Drag options to blanks, or click blank then click option'
Aexample.com
B1234567890abcdef
Cmyapp.appspot.com
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using the default appspot domain instead of your custom domain.
Using a certificate ID that does not exist or is invalid.
5fill in blank
hard

Fill all three blanks to update a domain mapping to use managed SSL and specify the domain.

GCP
gcloud app domain-mappings update [1] --certificate-management=[2] --project=[3]
Drag options to blanks, or click blank then click option'
Aexample.com
Bauto
Cmy-gcp-project
Dmanual
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'manual' instead of 'auto' for certificate management when you want automatic SSL.
Forgetting to specify the project ID if working with multiple projects.

Practice

(1/5)
1. What is the primary purpose of setting up a custom domain in Google Cloud Platform (GCP)?
easy
A. To use your own website address instead of a default GCP URL
B. To increase the storage capacity of your GCP project
C. To enable automatic backups for your cloud resources
D. To create virtual machines with custom names

Solution

  1. Step 1: Understand what a custom domain is

    A custom domain lets you use your own website address instead of a generic cloud URL.
  2. Step 2: Identify the purpose in GCP context

    In GCP, custom domains help users access services with familiar URLs, improving branding and trust.
  3. Final Answer:

    To use your own website address instead of a default GCP URL -> Option A
  4. Quick Check:

    Custom domain = personal website address [OK]
Hint: Custom domain means your own website address, not default URL [OK]
Common Mistakes:
  • Confusing custom domain with storage or VM settings
  • Thinking it changes backup or machine names
  • Assuming it increases resource limits
2. Which DNS record type must you configure to point your custom domain to a Google App Engine service?
easy
A. MX record
B. TXT record
C. SRV record
D. CNAME record

Solution

  1. Step 1: Identify DNS record types for domain pointing

    CNAME records map a domain or subdomain to another domain name, commonly used for pointing to cloud services.
  2. Step 2: Match with Google App Engine requirements

    Google App Engine custom domains require CNAME records to link your domain to their service address.
  3. Final Answer:

    CNAME record -> Option D
  4. Quick Check:

    Point domain to service = CNAME record [OK]
Hint: Use CNAME to point domain to cloud service address [OK]
Common Mistakes:
  • Using MX records which are for email routing
  • Using TXT records meant for verification
  • Confusing SRV records which are for service location
3. Given this snippet configuring a custom domain in GCP App Engine, what will happen if the DNS is not properly set?
gcloud app domain-mappings create example.com --certificate-management=automatic
medium
A. The command will fail with a syntax error
B. The domain will be mapped but users cannot access the app via example.com
C. The app will be accessible immediately without DNS changes
D. The SSL certificate will not be issued

Solution

  1. Step 1: Understand domain mapping command effect

    The command creates a domain mapping and requests SSL certificate automatically.
  2. Step 2: Consider DNS role in accessibility

    If DNS records do not point to GCP, users cannot reach the app via the custom domain despite mapping.
  3. Final Answer:

    The domain will be mapped but users cannot access the app via example.com -> Option B
  4. Quick Check:

    Mapping without DNS update = no access [OK]
Hint: Mapping alone doesn't work without DNS pointing [OK]
Common Mistakes:
  • Assuming command fails without DNS
  • Thinking app is accessible immediately
  • Believing SSL won't issue without DNS
4. You tried to add a custom domain to your GCP App Engine app but received an error: "Domain ownership verification failed." What is the most likely cause?
medium
A. You did not add the required TXT record to your domain's DNS
B. You used an incorrect CNAME record type
C. Your App Engine app is not deployed
D. You forgot to enable billing on your GCP project

Solution

  1. Step 1: Understand domain ownership verification process

    GCP requires you to prove you own the domain by adding a TXT record to DNS.
  2. Step 2: Identify cause of verification failure

    If the TXT record is missing or incorrect, verification fails and domain cannot be added.
  3. Final Answer:

    You did not add the required TXT record to your domain's DNS -> Option A
  4. Quick Check:

    Missing TXT record = ownership verification fail [OK]
Hint: Verify domain by adding TXT record in DNS [OK]
Common Mistakes:
  • Confusing CNAME with TXT for verification
  • Assuming app deployment affects verification
  • Thinking billing status causes verification error
5. You want to serve your website on both example.com and www.example.com using GCP App Engine with HTTPS. Which setup correctly achieves this with minimal manual DNS management?
hard
A. Map both domains; create TXT records for SSL; manually upload certificates
B. Map only example.com in App Engine; create A record for www pointing to example.com IP; manually manage SSL
C. Map both domains separately in App Engine and create CNAME for www pointing to ghs.googlehosted.com; use automatic SSL
D. Map www.example.com only; create CNAME for example.com pointing to www; disable SSL

Solution

  1. Step 1: Understand domain mapping for root and www

    Both example.com and www.example.com need mapping to serve content on both URLs.
  2. Step 2: Use recommended DNS and SSL setup

    Google recommends CNAME for www to ghs.googlehosted.com and automatic SSL management for ease and security.
  3. Final Answer:

    Map both domains separately in App Engine and create CNAME for www pointing to ghs.googlehosted.com; use automatic SSL -> Option C
  4. Quick Check:

    Separate mapping + CNAME + auto SSL = best practice [OK]
Hint: Map both domains and use CNAME for www with auto SSL [OK]
Common Mistakes:
  • Using A record for www which is not recommended
  • Mapping only one domain and missing the other
  • Disabling SSL or managing certificates manually unnecessarily
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard