nslookup(name server lookup)是一个用于查询 Internet域名信息或诊断DNS 服务器问题的工具。在windows和Linux都可以通过nslookup输入域名得到相应的IP地址。相反的,我们也可以通过输入IP地址来获得主机名。
获取更详细的应用,请参照 nslookup 命令用法 。
在Linux系统中,通过dig命令可以查询DNS的解析过程。
下面展示的是使用最简单的dig命令来查询DNS的结果,这对我们理解复杂一点的dig命令的结果很有帮助。
输出了DIG和Linux的版本号以及查询的域名
说明可以增加参数cmd。
表示下面信息是此次查询所得的结果,包含5个部分,分别是头部HEADER,查询部分QUESTION SECTION,回复部分ANSWER SECTION,权威机构部分AUTHORITY SECTION,附加部分ADDITIONAL SECTION。
opcode 操作码,QUERY,代表是查询操作
status 状态,NOERROR,代表没有错误
id 编号,7794,16bit数字,在dns协议中,通过编号匹配返回和查询。
flags 标志,如果出现就表示有标志,如果不出现就未设置标志:
qr query,查询标志,代表是查询操作
rd recursion desired, 代表希望进行递归(recursive)查询操作
ra recursive available 在返回中设置,代表查询的服务器支持递归(recursive)查询操作。
aa Authoritative Answer 权威回复,如果查询结果由管理域名的域名服务器而不是缓存服务器提供的,则称为权威回复。
QUERY 查询数,1代表1个查询,对应下面的QUESTION SECTION中的记录数
ANSWER 结果数,3代表有3项结果,对应下面ANSWER SECTION中的记录数
AUTHORITY 权威域名服务器记录数,4代表该域名有4个权威域名服务器,可供域名解析用。对应下面AUTHORITY SECTION
ADDITIONAL 格外记录数,4代表有4项格外记录。对应下面 ADDITIONAL SECTION。
查询部分,从左到右各部分意义:
1、要查询的域名,这里是hihuaning.com.,'.'代表根域名,com顶级域名,hihuaning二级域名
2、class,要查询信息的类别,IN代表类别为IP协议,即Internet。还有其它类别,比如chaos等,由于现在都是互联网,所以其它基本不用。
3、type,要查询的记录类型,A记录(Address),代表要查询ipv4地址。AAAA记录,代表要查询ipv6地址。
回应部分,回应有CNAME记录和A记录,说说CNAME记录从左到右各部分意义:
1、对应的域名,这里是hihuaning.com.,'.'代表根域名,com顶级域名,hihuaning二级域名
2、TTL,time ro live,缓存时间,单位秒。5,代表缓存域名服务器,可以在缓存中保存5秒该记录。
3、class,要查询信息的类别,IN代表类别为IP协议,即Internet。还有其它类别,比如chaos等,由于现在都是互联网,所以其它基本不用。
4、type,要查询的记录类型,CNAME记录,代表hihuaning.com有个别名samkingz.github.io
5、域名对应的CNAME别名
权威域名部分,回应都是NS记录(Name Server),NS记录从左到右各部分意义:
1、对应的域名,这里是fastlylb.net.,'.'代表根域名,com顶级域名,fastlylb二级域名
2、TTL,time ro live,缓存时间,单位秒。5,代表缓存域名服务器,可以在缓存中保存5秒该记录。
3、class,要查询信息的类别,IN代表类别为IP协议,即Internet。还有其它类别,比如chaos等,由于现在都是互联网,所以其它基本不用。
4、type,要查询的记录类型,NS,Name Server,NS记录,代表该记录描述了域名对应的权威域名解析服务器
5、域名对应域名对应的权威域名解析服务器。由于ns3.fastlylb.net.是fastlylb.net.的子域名,而解析子域名,又需要主域名的信息,为了打破这个死循环,需要在下面的额外记录中提供该服务器的ip地址。
额外记录部分,这里都是A记录,A记录从左到右各部分意义:
1、对应的域名,这里是ns1.fastlylb.net.,'.'代表根域名,net顶级域名,fastlylb二级域名,ns1是三级域名。
2、TTL,time ro live,缓存时间,单位秒。5,代表缓存域名服务器可以在缓存中保存5秒该记录。
3、class,要查询信息的类别,IN代表类别为IP协议,即Internet。还有其它类别,比如chaos等,由于现在都是互联网,所以其它基本不用。
4、type,要查询的记录类型,A记录,代表要查询ipv4地址。AAAA记录,代表要查询ipv6地址。
5、域名对应的ip地址。
查询耗时
查询使用的服务器地址和端口
查询的时间
回应的大小。收到(rcve, recieved)256字节。
使用 dig hihuaning.com +trace 命令,我们可以看到整个域名是如何发起和解析的,从根域名(.)到gTLD Server(.com),再到Name Server(hihuaning.com.)的整个过程都显示出来了。
获取更详细的应用,请参照 dig 命令用法 。
从dig查询结果看DNS的A记录和NS记录
深入分析java web技术内幕
在http://www.net.cn/里输入想查的域名就可以了588111.com的详细信息:
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Domain Name: 588111.COM
Registrar: XIN NET TECHNOLOGY CORPORATION
Whois Server: whois.paycenter.com.cn
Referral URL: http://www.xinnet.com
Name Server: NS2.XINNET.CN
Name Server: NS2.XINNETDNS.COM
Status: ok
Updated Date: 23-jul-2007
Creation Date: 23-jul-2007
Expiration Date: 23-jul-2008
>>>Last update of whois database: Wed, 31 Oct 2007 03:19:10 UTC <<<
NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar. Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.
TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrationsthe Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimileor (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.
The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.
[whois.paycenter.com.cn]
The Data in Paycenter's WHOIS database is provided by Paycenter
for information purposes, and to assist persons in obtaining
information about or related to a domain name registration
record.
Paycenter does not guarantee its accuracy. By submitting
a WHOIS query, you agree that you will use this Data only
for lawful purposes and that, under no circumstances will
you use this Data to:
(1) allow, enable, or otherwise support the transmission
of mass unsolicited, commercial advertising or solicitations
via e-mail (spam)or
(2) enable high volume, automated, electronic processes that
apply to Paycenter or its systems.
Paycenter reserves the right to modify these terms at any time.
By submitting this query, you agree to abide by this policy.
Domain Name:588111.com
Registrant:
feiying
beijing
100016
Administrative Contact:
fei ying
feiying
beijing
beijing Beijing 100016
China
tel: 86 0 378150797
fax: 86 0 378150797
378150797@qq.com
Technical Contact:
fei ying
feiying
beijing
beijing Beijing 100016
China
tel: 86 0 378150797
fax: 86 0 378150797
378150797@qq.com
Billing Contact:
fei ying
feiying
beijing
beijing Beijing 100016
China
tel: 86 0 378150797
fax: 86 0 378150797
378150797@qq.com
Registration Date: 2007-07-23
Update Date: 2007-07-23
Expiration Date: 2008-07-23
Primary DNS: ns2.xinnetdns.com 210.51.170.48
Secondary DNS: ns2.xinnet.cn 210.51.170.67
[HiChina Format]
Domain Name ..................... 588111.com
Registrant Organization ......... feiying
Registrant Address .............. beijing
100016
Administrative Name ............. fei ying
Administrative Organization ..... feiying
Administrative Address .......... beijing
beijing Beijing 100016
China
Administrative City ............. beijing
Administrative Province/State ... Beijing
Administrative Postal Code ...... 100016
Administrative Country Code ..... China
Administrative Phone Number ..... 86 0 378150797
Administrative Fax .............. 86 0 378150797
Administrative Email ............ 378150797@qq.com
Billing Name .................... fei ying
Billing Organization ............ feiying
Billing Address ................. beijing
beijing Beijing 100016
China
Billing City .................... beijing
Billing Province/State .......... Beijing
Billing Postal Code ............. 100016
Billing Country Code ............ China
Billing Phone Number ............ 86 0 378150797
Billing Fax ..................... 86 0 378150797
Billing Email ................... 378150797@qq.com
Technical Name .................. fei ying
Technical Organization .......... feiying
Technical Address ............... beijing
beijing Beijing 100016
China
Technical City .................. beijing
Technical Province/State ........ Beijing
Technical Postal Code ........... 100016
Technical Country Code .......... China
Technical Phone Number .......... 86 0 378150797
Technical Fax ................... 86 0 378150797
Technical Email ................. 378150797@qq.com
Expiration Date ................. 2008-07-23
要用到反向域名解析这个技术反向域名解析的意义:
最重要的解释就是这个IP地址的网络身份是被认可的。
反向域名解析的大体过程:
IP地址为a.b.c.d
查询时先向in-addr.arpa.域查询a.in-addr.arpa.域
返回一个ns地址,中国一般是apnic的dns
再向apnic的dns查询b.a.in-addr.arpa.域
返回一个ns地址,一般是isp的dns
再向isp的dns查询c.b.a.in-addr.arpa.域
返回一个ns地址,一般还是isp的dns或者授权后的dns
最后向这个dns查询d.c.b.a.in-addr.arpa.既c.b.a.in-addr.arpa.域中的记录d
返回一个对应的地址
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)