标签:png field ESS 用户 raw 地址 效果 down 就是
之前写过一篇博文,利用github pages五分钟建好个人网站+个人博客 ,在这篇
博文里,做了一件什么事呢?
github pages
和Jekyll
创建了个人网站,这个个人网站的原始域名是: logos23333.github.io
logos23333.top
域名logos23333.top
与logos23333.github.io
绑定,当用户在浏览器键入logos23333.top
时,自动解析到logos23333.github.io
我现在是大二下,开了computer networking 这门课程,所以我就想着用所学的知识具体解释一下这个第3点是怎么实现的,如果有不对的地方请不吝赐教!
当初我们绑定域名时做了两件事情:
域名管理
界面,找到了自己购买的域名logos23333.top
,对其进行解析,添加了三条记录。logos23333.top
。第一步有什么作用呢?
在Computer Networking A Top-Down Approach 一书中,我们对于一条DNS记录有以下的认识:
A resource record is a four-tuple that contains the following fields: (Name, Value, Type, TTL)
TTL is the time to live of the resource record; it determines when a resource should be removed from a cache.
TTL决定了一条记录在缓存中存在的时间,也就是说,TTL时间越长,缓存时间越长,更新越不容易及时生效,增加TTL值,可以加速网站访问速度,节约域名解析时间,相反,TTL时间越短,缓存时间越短,生效时间也就更快。
在下面的讨论中,我们忽略TTL,只关注Name
Value
和 Type
。
If Type=A, then Name is a hostname and Value is the IP address for the hostname. Thus, a Type A record provides the standard hostname-to-IP address mapping. As an example, (relay1.bar.foo.com, 145.37.93.126, A)
is a Type A record.
If Type=NS, then Name is a domain (such as foo.com) and Value is the hostname of an authoritative DNS server that knows how to obtain the IP addresses
for hosts in the domain. This record is used to route DNS queries further along in the query chain. As an example, (foo.com, dns.foo.com, NS) is a Type
NS record.
If Type=CNAME, then Value is a canonical hostname for the alias hostname Name. This record can provide querying hosts the canonical name for a hostname. As an example, (foo.com, relay1.bar.foo.com, CNAME) is a
CNAME record.
If Type=MX, then Value is the canonical name of a mail server that has an alias hostname Name. As an example, (foo.com, mail.bar.foo.com, MX) is an MX record. MX records allow the hostnames of mail servers to have simple aliases. Note that by using the MX record, a company can have the same
aliased name for its mail server and for one of its other servers (such as its Web server). To obtain the canonical name for the mail server, a DNS client would query for an MX record; to obtain the canonical name for the other server, the
DNS client would query for the CNAME record.
再来分析我们添加的三条记录:
@
的意思是直接解析,也就是说当我们解析logos23333.top
时,会自动去解析logos23333.github.io
的ip地址。192.30.252.153
是github服务器的名字。第3条记录也是一样的意思。我现在有以下几个点不明白:
logos23333.top
的意义在哪?似乎只添加那一条CNAME记录就能实现了。2018/3/12 23:51 在github pages的帮助界面,似乎官方并不是通过创建CNAME文件这种方式,而是直接在仓库的settings里改,好像是一样的效果。
标签:png field ESS 用户 raw 地址 效果 down 就是
原文地址:https://www.cnblogs.com/logosG/p/9180535.html