Github绑定自己的域名


详细内容可参该博客: https://blog.csdn.net/qq_41646249/article/details/111477328
该篇仅记录绑定过程,避免忘记。

1.注册自己的域名

域名可以再阿里云或者腾讯云进行购买。
阿里云域名链接,无需备案。

github pages快速入门

2.在GitHUb上创建一个自己的仓库,添加域名

2.1 创建仓库

创建一个仓库

2.2 添加域名

创建CNAME 文件,文件内容写自己的域名,不包含www.
添加域名

2.3 在Setting中将域名添加到Custom domain中

如果没有直接搜到Custom domain,需要在Pages->Build and deployment->修改为GitHUB Actions
添加域名到Custom domain

3.添加域名解析获取ip地址

ping xxxx.github.io

$ ping xxxx.github.io

Pinging xxxx.github.io [185.xxx.xxx.153] with 32 bytes of data:
Reply from 185.xxx.xxx.153:: bytes=32 time=131ms TTL=50
Reply from 185.xxx.xxx.153: bytes=32 time=135ms TTL=50
Reply from 185.xxx.xxx.153:: bytes=32 time=129ms TTL=50
Reply from 185.xxx.xxx.153:: bytes=32 time=132ms TTL=50

Ping statistics for 185.xxx.xxx.153:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 129ms, Maximum = 135ms, Average = 131ms

4.在阿里云修改域名解析记录

点击添加记录默认添加即可
在这里插入图片描述

5.ping 域名即可成功

succcess

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值