Create CNAME File #
First, create the CNAME file under the Gh-pages branch root of the library, and write to:
Www.111cn.net
Note the following points:
CNAME filename Uppercase
You do not need to add HTTP before the domain name
This uses the WWW subdomain instead of the top-level 111cn.net, Github recommends the use of a sub domain name
If the domain name ' 111cn.net ' also points to this library, Github Pages will automatically redirect it to ' Www.111cn.net '
Add CNAME Record #
Add a CNAME record to DNS and point www to Chenxsan.github.io.
Then check the DNS settings:
$ dig www.111cn.net +nostats +nocomments +nocmd
<<>> DiG 9.9.5-rpz2+rl.14038.05-p1 <<>> www.111cn.net +nostats +nocomments +nocmd
;; Global options: +cmd
www.111cn.net . in A
www.111cn.net . 3599 in cname Chenxsan.github.io.
chenxsan.github.io. 3599 in CNAME github.map.fastly.net.
github.map.fastly.net. 14 in A 103.245.222.133
Everything is fine.
Add A Record #
The CNAME record above only points the www.111cn.net to the Github server, where access to the 111cn.net domain name returns a 404 error, so it is also necessary to add two A records in DNS to two IPs in Github Pages (a better way is to add an ALIAS, but Google Domains does not support it:
192.30.252.153
192.30.252.154
Use the dig command to check DNS status again:
$ dig 111cn.net
; <<>> DiG 9.9.5-rpz2+rl.14038.05-p1 <<>> 111cn.net
;; Global options: +cmd
;; Got Answer:
;; ->>header<<-opcode:query, Status:noerror, id:56008
;; Flags:qr Rd RA; Query:1, Answer:2, authority:0, additional:1
;; OPT pseudosection:
; edns:version:0, Flags:; udp:512
;; Question section:
; 111cn.net. In A
;; ANSWER section:
111cn.net. 3599 in A 192.30.252.153
111cn.net. 3599 in A 192.30.252.154
;; Query time:588 msec
;; server:8.8.8.8#53 (8.8.8.8)
;; WHEN:FRI Nov 22:27:00 CST 2014
;; MSG SIZE rcvd:73
Then access to the 111cn.net domain name, has been able to open normally, and because of the first step in the settings, Github will help us redirect to the www.