Skip to content

[软技能] 第105天 域名解析它有哪几种方式? #1004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
haizhilin2013 opened this issue Jul 29, 2019 · 2 comments
Open

[软技能] 第105天 域名解析它有哪几种方式? #1004

haizhilin2013 opened this issue Jul 29, 2019 · 2 comments
Labels
软技能 软技能

Comments

@haizhilin2013
Copy link
Collaborator

第105天 域名解析它有哪几种方式?
昨天出的相关题:#999

@haizhilin2013 haizhilin2013 added the 软技能 软技能 label Jul 29, 2019
@xxf1996
Copy link

xxf1996 commented Jul 30, 2019

域名的解析也分很多种,以下列出的是我用的比较多的几种类型。

A类型

A类型可以将主机记录(二级域名)指向一个ipv4类型的ip地址;但是需要注意的是,该类型不能在ip地址后加上端口;比如:

主机记录:xx.test.com
记录值:aa.bb.cc.dd

上述记录的意思就是访问xx.test.com的时候实际上是访问ip地址为aa.bb.cc.dd的主机;但是如果在ip地址后加上端口号:

记录值:aa.bb.cc.dd:port

以上的记录值是非法的;其实我就是想将某个二级域名直接解析到主机的某个端口,然后尝试无果……

CNAME类型

CNAME类型的记录可以将当前记录指向另一个域名;需要注意的是仅仅是域名,不能在域名的后面添加路径或参数!!!

合法记录值:

xx.test.com
test.com
www.test.com

非法记录值:

test.com/path/
test.com/123.html
test.com?a=b

URL转发

URL转发就是将当前记录跳转到另一个url地址,因此只要是url地址可以访问的,都可以用来转发;不过URL转发还分为显性URL转发和隐性URL转发,它们的区别在于:

显性URL转发使用301永久重定向,即地址栏上的url地址会换成转发后的url地址,而非当前记录使用的url地址;而隐性URL转发使用的是302临时重定向,访问时浏览器地址栏依然是当前记录使用的url地址,但是实际访问的是转发的url地址。

@josh-axy
Copy link

josh-axy commented Aug 2, 2019

还有txt,dns校验普遍选用txt解析

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
软技能 软技能
Projects
None yet
Development

No branches or pull requests

3 participants