Add Domain in GitHub
-
click on
Profile Icon > Settings > Page
; it opens this link github.com/settings/pages -
click
Add a domain
button , page link will be github.com/settings/pages_verified_domains/new -
write domain name with without
www
; click on Add domain ; it will display to add DNS TXT record details -
keep open this page; copy these record and go to your domain provider; in my case it is namecheap.com
Add DNS record in domain provider
-
Login to namecheap.com
-
go to Domain List
-
click on Manage button against your domain
-
Click on Advanced DNS tab
-
Under HOST RECORDS panel click on ADD NEW RECORD plus icon
-
Add TXT record A. Select Type
TXT Record
B. Host Name: Copy the first value shown on github ( do not add the domain name as prefix ; just the value copied ) C. Value: Use the second code shown in github D. click on ✅ to save -
Add CNAME A. Select Type
ALIAS Record
B. Host Name: add@
C. Value: write<github-user-name>.github.io
D. click on ✅ to save -
Add CNAME A. Select Type
CNAME Record
B. Host Name: addwww
C. Value: write<github-user-name>.github.io
D. click on ✅ to saveNote: all old records ( the default one ) will be automatically removed.
-
Now go to github again and click on Verify button
-
it will be verified within 24 hours or immediately some time.
-
if it is fail to verify immediately; check after some hours and click on verify again option against your domain.
-
Finally it will look like this ; you can add multiple domain.
Bonus tip
you can validate your domain using dig
command ( need to install in system) and use it