Mapping a Custom Domain to Your GitBook Documentation
Learn how to map a custom domain like docs.example.com to a GitBook space, including DNS setup, HTTPS activation, verification steps, and the limitations you need to know.
02 Nov 2025, 20:27 UTC

Problem: Generic subdomains dilute brand identity
When a documentation space lives on GitBook’s default *.gitbook.io URL, readers see a generic address that does not reflect your product or company brand. This can cause confusion, especially when you share links in marketing materials or support tickets.
Thesis: GitBook’s custom‑domain feature lets you replace the subdomain with a branded URL while keeping the same editing, versioning, and collaboration workflow.
Setup process overview
- In GitBook, open the space settings and navigate to the Domain section.
- Enter the fully qualified domain you want to use (e.g.,
docs.example.com). - GitBook displays a target hostname (typically
cname.gitbook.com) that you must point to with a DNS CNAME record. - Add the CNAME record in your DNS provider’s console, wait for propagation, then enable automatic HTTPS in GitBook.
Worked example: mapping docs.example.com
Assume you own the domain example.com and have access to its DNS zone.
- Add the domain in GitBook
Permission needed: Admin role on the GitBook space.# In GitBook UI: Space Settings → Domain → Add domain # Enter: docs.example.com # GitBook shows target: cname.gitbook.com - Create the DNS CNAME
Where to run: Your DNS provider’s management console or via CLI if you control the zone (e.g.,# Example using BIND‑style zone file # docs.example.com. IN CNAME cname.gitbook.com.nsupdate). Risk: An incorrect CNAME will cause the domain to resolve to the wrong server, making the documentation unreachable. - Verify DNS propagation
Check: If the output does not show# Run from any machine with dig or nslookup # Replace with your actual domain $ dig docs.example.com CNAME +short # Expected output: cname.gitbook.com $ nslookup -type=CNAME docs.example.com # Expected output: canonical name = cname.gitbook.com.cname.gitbook.com, wait a few minutes and re‑run; propagation can take up to several hours depending on TTL. - Enable HTTPS in GitBook After the CNAME resolves, return to GitBook → Space Settings → Domain and click Verify domain. GitBook will attempt to provision a certificate via Let’s Encrypt. When successful, a padlock icon appears in the browser.
Trade‑off / limitation
- Plan requirement: Custom domains are only available on GitBook Pro or Enterprise plans; the Free plan does not expose this setting.
- Propagation delay: DNS changes may take from a few minutes to several hours. During this window, some users may see the old
*.gitbook.ioURL while others see the new domain, potentially leading to inconsistent access. - Misconfiguration risk: An incorrect CNAME or forgetting to re‑enable HTTPS after a DNS change can render the documentation inaccessible until the error is corrected.
Verification and closing actions
- DNS check: Use
digornslookupas shown above to confirm the CNAME points tocname.gitbook.com. - Browser check: Visit
https://docs.example.comand verify the SSL padlock and that the GitBook space loads correctly. - GitBook verification: In the Space Settings → Domain panel, ensure the status reads “Verified” and HTTPS is active.
- Update references: Change any internal links, bookmarks, or integration points (e.g., CI/CD pipelines that publish to GitBook) to use the new custom domain.
- Monitor: Review access logs or analytics for a few days to confirm traffic is arriving at the expected URL and that error rates remain low.
Once these steps are complete, your documentation will carry a consistent, branded address while retaining GitBook’s collaborative authoring and version‑control features.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.