GitHub + Hexo is usually xxx. GitHub. IO. How to create a blog domain name that is easy to remember?
1. Purchase a domain name
My domain name is bought in Tencent cloud, because Tencent cloud is a bit cheaper, also can go to ali cloud ten thousand net to buy.
- First of all toTencent cloud, the choice of
Domain name service
, choose a desired domain name suffix, different suffix price is not the same.
- Input the individual domain name you want, and then choose the right domain name suffix to buy.
2. Domain name resolution
- After the domain name is purchased, click in the upper right corner of the page
Management center
, the choice ofThe domain name management
。
- Then click on the menu bar of the domain you purchased
parsing
。
- Add the following three records according to the picture below. The first two records should be filled in according to mine, and the value of the last one should be changed to that of your blog
GitHub
Domain name, usuallyxxx.github.io
Just follow my instructions for the rest.
- After records are added, select the three records to be added and select the one in the upper part
Assignment to project
Button.
- And then assign it to
The default project
Can.
- And then click
Collaborative subdomain
And also assign it toThe default project
。
3. Create a CNAME file
- In the root directory of the local blog
source
Create a new folder namedCNAME
Note that this file does not carryAny suffix
.
- Open the
CNAME
File, in which to join the domain name you bought, note that the domain name to join does not bringhttp://
Don’t takewww
Listed as minejonzzs.cn
Just add this one.
- After saving the file, open the terminal
cd
Go to your blog directory and type the following command to redeploy your blog to the server.
hexo clean && hexo g && hexo d
Copy the code
This is the end of the method, wait a few minutes after the deployment is complete, and then try using your new domain name, whether it’s jonzzs.cn, www.jonzzs.cn, or jonzzs.github. IO, Finally, it will automatically point to the main domain name jonzzs.cn
In the future, you will be grateful for your hard work now, and wish you and your readers a better way of development.
My portal: blog, Book, Twitter, GitHub.