Search code examples
githubdnsgithub-pagesdigital-ocean

How does Github Pages add a subdomain for each repository?


For every single github repository like https://github.com/user/repository there is a corresponding github pages subdomain repository.github.io, and github just creates these subdomains under github.io on the fly.

Anyone know how github does this? I'm hoping there exists an easy to use DNS server / DNS Service that is also REST capable.


Solution

  • My guess is that GitHub is just using a wildcard subdomain that maps from *.github.io to some internal GitHub server, which then serves the correct repository based on the requested URL.

    I don't know what you're trying to do with GitHub's DNS server, but you can create a repo via the GitHub API: How to create repository in github through github API?