GitHub Pages binding domain from Ali cloud

Brief introduction

DNS

Tencent cloud DNS settings

Write pictures described here

Ali Cloud DNS settings

Write pictures described here

Record Type

A记录: 将域名指向一个IPv4地址(例如:8.8.8.8CNAME:将域名指向另一个域名(例如www.qcloud.comMX: 将域名指向邮件服务器地址
TXT: 可任意填写,长度限制255,通常做SPF记录(反垃圾邮件)
NS: 域名服务器记录,将子域名指定其他DNS服务器解析
AAAA:将域名指向一个iPv6地址(例如:ff06:0:0:0:0:0:0:c3SRV:记录提供特定服务的服务器(例如_xmpp-server._tcp

Host Record

要解析www.qcloud.com,请填写www。
主机记录就是域名前缀,常见用法有:

www: 解析后的域名为www.qcloud.com。
@: 直接解析主域名 qcloud.com。
*: 泛解析,匹配其他所有域名 *.qcloud.com。
mail: 将域名解析为mail.qcloud.com,通常用于解析邮箱服务器。
二级域名: 如:abc.qcloud.com,填写abc。
手机网站: 如:m.qcloud.com,填写m

I bought on Ali goes to a new domain: liuzhiwei.top, I have set up their own blog in the Pages and the GitHub: http://liufengyuqing.github.io . Now I want to map liuzhiwei.top to http://liufengyuqing.github.io
main reference:

  1. Setting up a custom domain with GitHub Pages
  2. Create a GitHub technology blog Raiders - Part IX: CNAME binding domain
  3. Hexo build free Web application on github - Section 4.3: Set the domain name

Step 1: Create CNAME file

New in the root directory of the file repository GitHub blog CNAME (Note that no suffix), add a line of text in the file that tells Github Pages domain name server you want to specify. The domain name can not contain the prefix information that you can not add http: // prefix.
Write pictures described here

CNAME file name must be capitalized, or can not identify and resolve Github Pages server.

I appeared in such problems. My CNAME binding domain are correct, by ping yuanzb.com and ping yuanzb.github.io two instructions, I found that they all point to the same IP address (ie IP address of my blog), but I use the browser access time, there will be prompt Site not Found, this time I can only reasonable doubt Github Pages server did not bind to yuanzb and yuanzb.github.io that my CNAME file setting error. Google found the case CNAME file name will have an impact (My custom domain is not working) , the evil of the Windows system file names are not case sensitive after, so even if you change the CNAME case locally and then push to github, or not use. . . I had to go up to github a modification to uppercase. . . pit. . .
CNAME and each file can only specify a domain name. For more information on adding CNAME documents can be found Adding a CNAME file to your repository.

The goal is the first step, after reading your Github CNAME, Github server sets yuanzb.me for your main domain, then yuanzb.github.io redirected to yuanzb.com.


Step two: CNAME binding domain
logon domain Ali cloud single console, add as shown in the DNS resolution
Write pictures described here

Use the default DNS server Ali million net cloud provides. Of course, you can also use the DNS server DNSPOD provided, so you can make your domain name more rapid spread abroad. When you use the DNS server DNSPOD provided, in addition to the DNS server is not the same, other arrangements (such as A and CNAME records) are the same. Below we briefly analyze the meaning that we added an A record and CNAME records.

In the DNS, A is directly specifying a recorded IP, CNAME is renamed, points to another domain.

  1. Ali cloud console, set the host record www, record type A, record value IP192.30.252.153. Github Pages 192.30.252.153 which is specified by the server IP address, access to the IP address means that access Github Pages.

  2. Ali cloud console, set the record @ host, record type as CNAME, record values are liufengyuqing.github.io.. It said it would http://liuzhiwei.top the main domain name mapping liufengyuqing.github.io. Do not forget that here there is a point behind the record value .io.!

  3. But many times, we just want to be bound to the blog subdomain address. For example, if you want to map to yuanzb.github.io blog.yuanzb.com (ie blog subdomain address the main domain name address is www.yuanzb.com), then you should fill in the blog host record, record type as CNAME, record value is yuanzb.github.io. Because your main domain name has default yuanzb.com, so the main domain name and host records together is blog.yuanzb.com. And this time, CNAME contents of the file you github project should also be changed accordingly blog.yuanzb.com, because you want to yuanzb.github.io and blog.yuanzb.com bind, rather than with www.yuanzb. com binding.

  4. If you want to map www.yuanzb.com (ie, the main domain address) to yuanzb.github.io, then the host record is www, record type is A, the recorded value is the specific IP address (is 192.30 in our example. 252.153,192.30.252.154). Because your main domain name has default yuanzb.com, so the main domain name and host records together is www.yuanzb.com.

Added: You can have multiple domain names mapped to xxxxx.github.io like your own site, but need to create different content CNAME file.
Note, .me is already a top-level domain (and .com, .org and other domain name is the same level), so you need to use A record for domain name resolution.

The second step aims to tell all DNS servers for yuanzb.me access will be redirected to yuanzb.github.io.


The third step: the long wait
for a global resolve to take effect, have to wait a while, and can also be set to ping your own right. Ali cloud domain name service works is that after you update the DNS, the first is Ali million net cloud resolution, and then spread to the major operators of the DNS server, flush the DNS cache, bringing your domain name can be accessed. It is to take effect, be patient

Published 175 original articles · won praise 76 · Views 230,000 +

Guess you like

Origin blog.csdn.net/qq_29232943/article/details/52786603