How to Add Custom Domain To GitHub Pages? Last Updated : 02 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Adding a custom domain to your GitHub Pages site can significantly enhance its professional appearance and make it easier for your audience to remember and access. This guide will walk you through the process step-by-step, ensuring you can easily configure your custom domain and optimize your site's visibility.PrerequisitesHow to Publish a Static Website on GitHub?How to Deploy Your React Websites on GitHub?Steps to Add Custom Domain To GitHub PagesStep 1: Getting the custom domainThe first step is to buy a domain of our choice. We can buy from any domain registered, usually, Google domains are considered the best in the market. However, I chose to go with GoDaddy because of their discount price on the domain of my choice. I got webrachna.in, which will be connected to GitHub pages in subsequent steps.Step 2: The gh-pages branchIn this step, we will create a new branch in our project repository and give it a name gh-pages.Now we will make gh-pages the default branch in this repository. By first going to settings and clicking the branch tab.Now we will go the options page inside settings and scroll to GitHub Pages section. Here we will get a URL to the website that we just hosted. In this case the URL id https://ankitkj1999.github.io/WebRachnaStep 3: Connecting domain to the websiteNow we will visit the DNS management page of the domain that we have bought and below is the view of GoDaddy's DNS page.Here we will delete all and then add the four A type records as shown in the image below. The first four records are what we have to add.Now we will go back to the GitHub Pages section in the settings and add our custom domain in the field asking for it and hit save. Then the page will reload, and we will see our custom domain in the place of the default github.io URL. Now we can see our website hosted on our custom domain. Most of the time it works quickly but it can take up to 24 hours to connect our custom domain to GitHub pages.And if you want to host your static website on Firebase which is a comparatively better option refer to this article: Hosting A Static Website On Firebase For Free. Comment More infoAdvertise with us A ankit_kumar_ Follow Improve Article Tags : Git GitHub Similar Reads Frontend Developer Interview Questions and Answers Frontend development is an important part of web applications, and it is used to build dynamic and user-friendly web applications with an interactive user interface (UI). Many companies are hiring skilled Frontend developers with expertise in HTML, CSS, JavaScript, and modern frameworks and librarie 15+ min read Git Tutorial Git is an essential tool for developers, enabling them to manage and track project changes. Whether you're working on a solo project or collaborating with a team, Git keeps everything organized and under control. This Git Tutorial, from beginner to advanced, will give you a complete understanding of 12 min read Git Cheat Sheet Git Cheat Sheet is a comprehensive quick guide for learning Git concepts, from very basic to advanced levels. By this Git Cheat Sheet, our aim is to provide a handy reference tool for both beginners and experienced developers/DevOps engineers. This Git Cheat Sheet not only makes it easier for newcom 10 min read Git Rebase Git Rebase is a command that moves or combines a sequence of commits to a new base commit. It helps you place your changes on top of another commit, resulting in a cleaner, linear history, especially useful when working with feature branches. Unlike git merge, which creates a merge commit to combine 10 min read Version Control Systems Version Control Systems (VCS) are essential tools used in software development and collaborative projects to track and manage changes to code, documents, and other files. Whether you're working alone or as part of a team, version control helps ensure that your work is safe, organized, and easy to co 7 min read Git Bash Git bash is a command-line tool that is used as Git CLI emulation for Microsoft Windows. It provides a terminal-like interface and enables users to run Git commands and interact with a repository, as well as offering Unix command line features. Essentially, Git Bash brings the powerful functionaliti 9 min read How to Create a New Branch in Git? Git is a powerful and widely used version control system that helps developers manage code changes across projects efficiently. One of the fundamental features of Git is branching, which allows developers to diverge from the main line of development and work on different tasks or features independen 4 min read 50+ Essential Git Commands for Beginners and Developers Git is a powerful version control system that helps developers track changes, collaborate seamlessly, and manage codebases efficiently. Whether you're working on a solo project or collaborating with a team, Git ensures your work is safe, versioned, and organized. So weâll explore 50+ essential Git c 7 min read How to Set Git Username and Password in GitBash? Setting up your Git username and password is an essential step when working with Git repositories. It helps you confirm your identity when sending (pushing) changes or getting (pulling) updates from a remote repository. In this guide, we will show you how to easily set your Git username and password 3 min read How To Get Changes From Master Into a Branch in Git? In Git, branches are essential for organizing and managing development work. Whether you are working on a feature, a bug fix, or any other task, you often work in a separate branch so that the changes donât directly affect the master or main branch (the primary production branch).There are two main 3 min read Like