[Hexo personal blog] domain binding

These days, I have an idea that every time I input my own nateshao.github. IO to visit my blog, the domain name is too long. All using their own domain name to bind www.nateshao.cn Take 3 minutes to read this brief tutorial on how to bind your own domain name to your personal blog.

Purchase personalized domain name

Ali cloud is recommended here, after all, large domestic companies, both kind and reliable. There is also goDaddy, recommended by many. This article takes Ali Cloud as an example.

  • First register aliyun account, if you have taobao account, you can directly log in.
  • After the login, the first real name authentication (purchase domain name to use, how to real name authentication, here skipped).

Binding domain

  • Win +R Shortcut keys To open the Run window, enter CMD to runCommand console. Or just go to ping yourname.github. IO.
  • Enter the domain name resolution list and resolve the purchased domain name.
1
  • Remove the default and add the following resolution, as shown:
2

Create a CNAME file

In the source folder under your local blog site path, create a folder namedCNAME“, and write the domain name you purchased.

Note: If do not do this step each timehexo dAfter deploying to Github, the domain name in the corresponding repository will be reset to the original username. Github. IO, you need to set it to your domain name again, which is very troublesome.

Set the domain name

Once configured, log in to Github, go to the repository of the blog site, and set the domain name:

5
6

By the way, after you bind the new domain name, your original username. Github. IO. It’s not deactivated, it’s automatically redirected to your new domain.

At this point, the domain name is tied to your blog site.