Bird
Raised Fist0
Firebasecloud~20 mins

Custom domain configuration in Firebase - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Firebase Custom Domain Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
What happens after adding a custom domain in Firebase Hosting?

You add a custom domain to your Firebase Hosting project and verify ownership. What is the expected behavior immediately after this setup?

AThe custom domain will serve content only over HTTP until you enable HTTPS in the Firebase console.
BYou must manually upload an SSL certificate before the site is served on HTTPS.
CFirebase automatically provisions an SSL certificate and starts serving your site on HTTPS for the custom domain.
DFirebase Hosting will serve the site on the custom domain only after you deploy your site again.
Attempts:
2 left
💡 Hint

Think about Firebase Hosting's automatic security features.

❓ Configuration
intermediate
2:00remaining
Which DNS record is required to verify a custom domain in Firebase?

To verify ownership of a custom domain in Firebase Hosting, which DNS record must you add to your domain's DNS settings?

AA CNAME record pointing to firebaseapp.com.
BA TXT record with a Firebase verification token.
CAn MX record with Firebase's mail server address.
DAn SRV record specifying Firebase Hosting service.
Attempts:
2 left
💡 Hint

Verification usually involves proving domain ownership via a special text entry.

❓ Architecture
advanced
2:30remaining
How does Firebase Hosting handle traffic routing for multiple custom domains?

You have configured multiple custom domains for a single Firebase Hosting site. How does Firebase route incoming requests?

AFirebase routes requests based on the Host header to the same content for all configured domains.
BFirebase requires separate hosting sites for each custom domain to route traffic correctly.
CRequests are routed randomly among the configured domains unless you set up redirects.
DFirebase uses IP-based routing to distinguish traffic for each custom domain.
Attempts:
2 left
💡 Hint

Consider how web servers use the Host header to serve content.

❓ security
advanced
2:00remaining
What security feature does Firebase Hosting provide automatically for custom domains?

After adding a custom domain to Firebase Hosting, which security feature is automatically enabled to protect your site?

AAutomatic HTTPS with free SSL certificates from Let's Encrypt.
BMandatory two-factor authentication for all visitors.
CIP whitelisting to restrict access to your site.
DAutomatic firewall rules blocking all non-Google IPs.
Attempts:
2 left
💡 Hint

Think about how Firebase secures traffic between browsers and servers.

✅ Best Practice
expert
3:00remaining
What is the recommended approach to handle subdomain redirects in Firebase Hosting?

You want to redirect all traffic from blog.example.com to www.example.com/blog. What is the best way to configure this in Firebase Hosting?

Firebase
firebase.json
AConfigure a Firebase Cloud Function to handle requests to <code>blog.example.com</code> and respond with a redirect.
BSet up a DNS CNAME record from <code>blog.example.com</code> to <code>www.example.com/blog</code>.
CUse Firebase Hosting rewrite rules to redirect <code>blog.example.com</code> to <code>/blog</code> on <code>www.example.com</code>.
DCreate a Firebase Hosting redirect rule in <code>firebase.json</code> that redirects <code>blog.example.com</code> to <code>https://www.example.com/blog</code>.
Attempts:
2 left
💡 Hint

Consider how Firebase Hosting handles domain-based redirects in its configuration file.

Practice

(1/5)
1. What is the main purpose of configuring a custom domain in Firebase Hosting?
easy
A. To enable Firebase Authentication for your app
B. To increase the storage capacity of your Firebase project
C. To create a new Firebase project automatically
D. To use your own website address instead of the default Firebase URL

Solution

  1. Step 1: Understand Firebase Hosting default URLs

    Firebase Hosting provides a default URL, but it is not personalized.
  2. Step 2: Purpose of custom domain

    Configuring a custom domain lets you use your own website address, making it easier for users to find your site.
  3. Final Answer:

    To use your own website address instead of the default Firebase URL -> Option D
  4. Quick Check:

    Custom domain = personal website address [OK]
Hint: Custom domain means your own website address, not Firebase default [OK]
Common Mistakes:
  • Confusing custom domain with Firebase project storage
  • Thinking it enables authentication automatically
  • Assuming it creates a new Firebase project
2. Which DNS record type is commonly required to verify domain ownership when setting up a custom domain in Firebase Hosting?
easy
A. CNAME record
B. MX record
C. TXT record
D. A record

Solution

  1. Step 1: Identify verification method

    Firebase asks you to add a DNS record to prove you own the domain.
  2. Step 2: Common DNS record for verification

    TXT records are used to store text data for verification purposes.
  3. Final Answer:

    TXT record -> Option C
  4. Quick Check:

    Domain verification uses TXT record [OK]
Hint: Verification usually needs a TXT DNS record [OK]
Common Mistakes:
  • Using MX record which is for email routing
  • Confusing CNAME with verification record
  • Using A record which points IP address
3. You added a CNAME record pointing www.example.com to ghs.googlehosted.com as Firebase instructed. What will happen when users visit www.example.com after DNS propagation?
medium
A. Users will get a DNS error and cannot reach the site
B. Users will see your Firebase hosted website at www.example.com
C. Users will be redirected to Firebase console login page
D. Users will see a default Firebase project page

Solution

  1. Step 1: Understand CNAME record purpose

    CNAME points your domain to Firebase Hosting's server address.
  2. Step 2: Effect after DNS propagation

    Once DNS updates, visiting www.example.com loads your Firebase hosted site.
  3. Final Answer:

    Users will see your Firebase hosted website at www.example.com -> Option B
  4. Quick Check:

    CNAME to Firebase = site loads correctly [OK]
Hint: CNAME to Firebase host means your site shows on your domain [OK]
Common Mistakes:
  • Expecting DNS error after correct CNAME setup
  • Thinking users get Firebase console page
  • Assuming default Firebase page shows instead
4. You configured your custom domain but users report your site is not loading. Which of these is the most likely cause?
medium
A. You forgot to verify domain ownership by adding the required DNS record
B. You used an A record instead of a TXT record for verification
C. You deployed your Firebase project without enabling billing
D. You did not enable Firebase Authentication

Solution

  1. Step 1: Check domain verification requirement

    Firebase requires domain ownership verification before serving your site.
  2. Step 2: Effect of missing verification

    If verification is missing, Firebase will not serve your site on the custom domain.
  3. Final Answer:

    You forgot to verify domain ownership by adding the required DNS record -> Option A
  4. Quick Check:

    Missing verification = site won't load [OK]
Hint: Always verify domain ownership to activate custom domain [OK]
Common Mistakes:
  • Confusing billing with domain verification
  • Thinking authentication affects domain setup
  • Using wrong DNS record type for verification
5. You want to configure both example.com and www.example.com to serve your Firebase hosted site securely. Which is the best approach?
hard
A. Add both domains in Firebase Hosting, verify ownership for both, and set DNS records accordingly
B. Only add www.example.com in Firebase and redirect example.com to it without verification
C. Add example.com only and rely on Firebase to automatically serve www.example.com
D. Use only example.com and set a CNAME record for www.example.com pointing to example.com

Solution

  1. Step 1: Add both domains in Firebase Hosting

    Firebase requires each domain to be added and verified separately.
  2. Step 2: Verify ownership and set DNS for both

    You must verify both domains and configure DNS records to point to Firebase Hosting.
  3. Step 3: Ensure HTTPS works on both domains

    Firebase provisions SSL certificates for each verified domain to serve securely.
  4. Final Answer:

    Add both domains in Firebase Hosting, verify ownership for both, and set DNS records accordingly -> Option A
  5. Quick Check:

    Both domains added and verified = secure site on both [OK]
Hint: Add and verify each domain separately for full coverage [OK]
Common Mistakes:
  • Assuming Firebase auto-serves unadded domains
  • Skipping verification for one domain
  • Using CNAME incorrectly for apex domain
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