Linux Nslookup命令
1.找出域的“A”记录(IP地址)
# nslookup yahoo.com Server: 4.2.2.2 Address: 4.2.2.2#53 Non-authoritative answer: Name: yahoo.com Address: 72.30.38.140 Name: yahoo.com Address: 98.139.183.24 Name: yahoo.com Address: 209.191.122.70以上 4.2.2.2公共DNS服务器和下面的命令查询域 www.yahoo.com部分显示 非权威的答案 :显示 www.yahoo.com 的记录
2.找出反向域查找
# nslookup 209.191.122.70 Server: 4.2.2.2 Address: 4.2.2.2#53 Non-authoritative answer: 70.122.191.209.in-addr.arpa name = ir1.fp.vip.mud.yahoo.com. Authoritative answers can be found from:
3.找出特定的域查找。
# nslookup ir1.fp.vip.mud.yahoo.com. Server: 4.2.2.2 Address: 4.2.2.2#53 Non-authoritative answer: Name: ir1.fp.vip.mud.yahoo.com Address: 209.191.122.70
4.查询MX(邮件交换)记录。
# nslookup -query=mx www.yahoo.com Server: 4.2.2.2 Address: 4.2.2.2#53 Non-authoritative answer: www.yahoo.com canonical name = fd-fp3.wg1.b.yahoo.com. fd-fp3.wg1.b.yahoo.com canonical name = ds-fp3.wg1.b.yahoo.com. ds-fp3.wg1.b.yahoo.com canonical name = ds-any-fp3-lfb.wa1.b.yahoo.com. ds-any-fp3-lfb.wa1.b.yahoo.com canonical name = ds-any-fp3-real.wa1.b.yahoo.com. Authoritative answers can be found from: wa1.b.yahoo.com origin = yf1.yahoo.com mail addr = hostmaster.yahoo-inc.com serial = 1344827307 refresh = 30 retry = 30 expire = 86400 minimum = 1800MX记录被用于域名映射到该域的邮件交换服务器列表。 因此,它告诉接收/发送到 @ yahoo.com将被路由到邮件服务器的所有邮件。
5.查询NS(Nameservers)记录。
# nslookup -query=ns www.yahoo.com Server: 4.2.2.2 Address: 4.2.2.2#53 Non-authoritative answer: www.yahoo.com canonical name = fd-fp3.wg1.b.yahoo.com. fd-fp3.wg1.b.yahoo.com canonical name = ds-fp3.wg1.b.yahoo.com. ds-fp3.wg1.b.yahoo.com canonical name = ds-any-fp3-lfb.wa1.b.yahoo.com. ds-any-fp3-lfb.wa1.b.yahoo.com canonical name = ds-any-fp3-real.wa1.b.yahoo.com. Authoritative answers can be found from: wa1.b.yahoo.com origin = yf1.yahoo.com mail addr = hostmaster.yahoo-inc.com serial = 1344827782 refresh = 30 retry = 30 expire = 86400 minimum = 1800
6.查询SOA(开始授权)记录。
# nslookup -type=soa www.yahoo.com Server: 4.2.2.2 Address: 4.2.2.2#53 Non-authoritative answer: www.yahoo.com canonical name = fd-fp3.wg1.b.yahoo.com. fd-fp3.wg1.b.yahoo.com canonical name = ds-fp3.wg1.b.yahoo.com. ds-fp3.wg1.b.yahoo.com canonical name = ds-any-fp3-lfb.wa1.b.yahoo.com. ds-any-fp3-lfb.wa1.b.yahoo.com canonical name = ds-any-fp3-real.wa1.b.yahoo.com. Authoritative answers can be found from: wa1.b.yahoo.com origin = yf1.yahoo.com mail addr = hostmaster.yahoo-inc.com serial = 1344827965 refresh = 30 retry = 30 expire = 86400 minimum = 1800
7.查询所有可用的DNS记录。
# nslookup -query=any yahoo.com Server: 4.2.2.2 Address: 4.2.2.2#53 Non-authoritative answer: yahoo.com origin = ns1.yahoo.com mail addr = hostmaster.yahoo-inc.com serial = 2012081016 refresh = 3600 retry = 300 expire = 1814400 minimum = 600 Name: yahoo.com Address: 98.139.183.24 Name: yahoo.com Address: 209.191.122.70 Name: yahoo.com Address: 72.30.38.140 yahoo.com mail exchanger = 1 mta7.am0.yahoodns.net. yahoo.com mail exchanger = 1 mta5.am0.yahoodns.net. yahoo.com mail exchanger = 1 mta6.am0.yahoodns.net. yahoo.com nameserver = ns3.yahoo.com. yahoo.com nameserver = ns4.yahoo.com. yahoo.com nameserver = ns2.yahoo.com. yahoo.com nameserver = ns8.yahoo.com. yahoo.com nameserver = ns1.yahoo.com. yahoo.com nameserver = ns6.yahoo.com. yahoo.com nameserver = ns5.yahoo.com. Authoritative answers can be found from:
8.启用调试模式
要启用 调试模式 “组调试”将返回详细信息,如 TTL,这里的输出。# nslookup -debug yahoo.com > set debug > yahoo.com Server: 4.2.2.2 Address: 4.2.2.2#53 ------------ QUESTIONS: yahoo.com, type = A, class = IN ANSWERS: -> yahoo.com internet address = 72.30.38.140 ttl = 1523 -> yahoo.com internet address = 98.139.183.24 ttl = 1523 -> yahoo.com internet address = 209.191.122.70 ttl = 1523 AUTHORITY RECORDS: ADDITIONAL RECORDS: ------------ Non-authoritative answer: Name: yahoo.com Address: 72.30.38.140 Name: yahoo.com Address: 98.139.183.24 Name: yahoo.com Address: 209.191.122.70在本文中,我们试图掩盖Nslookup的命令,它可以帮助你找到 (DNS)域名服务相关的信息。 下一篇文章将在Linux上 挖命令是与nslookup类似。如果你喜欢的文章,请与您的朋友分享,不要忘记通过评论框提供您宝贵的反馈。