《工具录》nslookup

nslookup命令解析 1、作用: 查询DNS的记录,查看域名解析是否正常,在网络故障的时候用来诊断网络问题。 2、命令解析 命令格式:nslookup domain[dns-server] 示例:nslookup www.163.com 第一部分 服务器:本机DNS服务器信息。 192.168.3.1是我当前计算机的DNS服务器,由于是内网服务器名称无法获取 第二部分 非权威应答:Non-authoritative answer,除非实际存储DNS Server中获得域名解析回答的,都称为非权威应答。也就. 阅读详情


本文以 kali-linux-2023.3-vmware-amd64 为例。

1:nslookup

nslookup(name server lookup)常用于域名解析和网络故障排除。

nslookup 有两种操作模式,两种模式功能一致:

  • 交互式模式
    适用于在一个会话中执行多个查询或操作。

  • 命令行模式(非交互模式)
    适用于执行一次性的简单查询或将其嵌入到脚本中。

2:选项介绍

选项总览:man nslookup 命令中的解释。

NSLOOKUP(1)                         BIND 9                        NSLOOKUP(1)

NAME
       nslookup - query Internet name servers interactively

SYNOPSIS
       nslookup [-option] [name | -] [server]

DESCRIPTION
       nslookup is a program to query Internet domain name servers.  nslookup
       has  two  modes: interactive and non-interactive. Interactive mode al‐
       lows the user to query name  servers  for  information  about  various
       hosts and domains or to print a list of hosts in a domain.  Non-inter‐
       active  mode prints just the name and requested information for a host
       or domain.

ARGUMENTS
       Interactive mode is entered in the following cases:

       a. when no arguments are given (the default name server is used);

       b. when the first argument is a hyphen (-) and the second argument  is
          the host name or Internet address of a name server.

       Non-interactive  mode is used when the name or Internet address of the
       host to be looked up is given as the first argument. The optional sec‐
       ond argument specifies the host name or address of a name server.

       Options can also be specified on the command line if they precede  the
       arguments  and  are prefixed with a hyphen. For example, to change the
       default query type to host information, with an initial timeout of  10
       seconds, type:

          nslookup -query=hinfo  -timeout=10

       The  -version  option  causes nslookup to print the version number and
       immediately exit.

INTERACTIVE COMMANDS
       host [server]
              This command looks up information for host  using  the  current
              default server or using server, if specified. If host is an In‐
              ternet  address and the query type is A or PTR, the name of the
              host is returned. If host is a name and does not have a  trail‐
              ing period (.), the search list is used to qualify the name.

              To look up a host not in the current domain, append a period to
              the name.

       server domain | lserver domain
              These  commands  change  the  default server to domain; lserver
              uses the initial server to look up  information  about  domain,
              while  server uses the current default server. If an authorita‐
              tive answer cannot be found, the names of  servers  that  might
              have the answer are returned.

       root   This command is not implemented.

       finger This command is not implemented.

       ls     This command is not implemented.

       view   This command is not implemented.

       help   This command is not implemented.

       ?      This command is not implemented.

       exit   This command exits the program.

       set keyword[=value]
              This  command  is used to change state information that affects
              the lookups. Valid keywords are:

              all    This keyword prints the current values of the frequently
                     used options to set. Information about the  current  de‐
                     fault server and host is also printed.

              class=value
                     This keyword changes the query class to one of:

                     IN     the Internet class

                     CH     the Chaos class

                     HS     the Hesiod class

                     ANY    wildcard

                     The  class  specifies the protocol group of the informa‐
                     tion. The default is IN; the abbreviation for this  key‐
                     word is cl.

              nodebug
                     This keyword turns on or off the display of the full re‐
                     sponse  packet,  and  any intermediate response packets,
                     when searching. The default for this keyword is nodebug;
                     the abbreviation for this keyword is [no]deb.

              nod2   This keyword turns debugging mode on or off.  This  dis‐
                     plays  more about what nslookup is doing. The default is
                     nod2.

              domain=name
                     This keyword sets the search list to name.

              nosearch
                     If the lookup request contains at least one period,  but
                     does  not  end  with a trailing period, this keyword ap‐
                     pends the domain names in the domain search list to  the
                     request  until  an  answer  is  received. The default is
                     search.

              port=value
                     This keyword changes the  default  TCP/UDP  name  server
                     port  to  value from its default, port 53. The abbrevia‐
                     tion for this keyword is po.

              querytype=value | type=value
                     This keyword changes the type of the  information  query
                     to value. The defaults are A and then AAAA; the abbrevi‐
                     ations for these keywords are q and ty.

                     Please  note  that  it  is  only possible to specify one
                     query type. Only the default behavior looks up both when
                     an alternative is not specified.

              norecurse
                     This keyword  tells  the  name  server  to  query  other
                     servers if it does not have the information. The default
                     is   recurse;  the  abbreviation  for  this  keyword  is
                     [no]rec.

              ndots=number
                     This keyword sets the number of dots (label  separators)
                     in  a domain that disables searching. Absolute names al‐
                     ways stop searching.

              retry=number
                     This keyword sets the number of retries to number.

              timeout=number
                     This keyword changes the  initial  timeout  interval  to
                     wait for a reply to number, in seconds.

              novc   This keyword indicates that a virtual circuit should al‐
                     ways  be used when sending requests to the server.  novc
                     is the default.

              nofail This keyword tries the next nameserver if  a  nameserver
                     responds with SERVFAIL or a referral (nofail), or termi‐
                     nates  the  query (fail) on such a response. The default
                     is nofail.

RETURN VALUES
       nslookup returns with an exit status of 1 if any query failed,  and  0
       otherwise.

IDN SUPPORT
       If  nslookup  has  been built with IDN (internationalized domain name)
       support, it can accept and display non-ASCII  domain  names.  nslookup
       appropriately  converts  character  encoding  of  a domain name before
       sending a request to a DNS server  or  displaying  a  reply  from  the
       server.   To  turn off IDN support, define the IDN_DISABLE environment
       variable. IDN support is disabled if the variable is set when nslookup
       runs, or when the standard output is not a tty.

FILES
       /etc/resolv.conf

SEE ALSO
       dig(1), host(1), named(8).

AUTHOR
       Internet Systems Consortium

COPYRIGHT
       2023, Internet Systems Consortium

9.19.17-2~kali1-Kali              2023-09-08                      NSLOOKUP(1)

3:示例 - 命令行模式

3.1:查询类型设置

基本语法:nslookup [-ty=<type>] <target>

示例 3.1-1:在不指定参数的情况下,默认查询类型为 A。

nslookup [-ty=a] baidu.com

结果:

在这里插入图片描述

解释:

  • Server、Address:
    本次查询的 DNS 服务器。可以自己指定。默认情况下 DNS 服务器的端口为 53。

  • Non-authoritative answer(非权威应答):
    说明回答来自其他服务器的缓存,而不是权威 DNS 服务器。

示例 3.1-2:PTR 反向 DNS 解析。

nslookup -ty=ptr 8.8.8.8

结果:

在这里插入图片描述

3.2:指定 DNS 服务器

基本语法:nslookup <target> <DNS server>

示例 3.2-1:指定服务器为 8.8.8.8。

nslookup google.com 8.8.8.8

结果:

在这里插入图片描述

4:示例 - 交互模式

示例 4-1:查找权威服务器。

# 1、
nslookup

# 2、
set ty=NS

# 3、查看当前配置
set all

# 4、查找 baidu.com 对应的权威服务器
baidu.com

结果:

在这里插入图片描述

示例 4-2:指定 dns.baidu.com 作为 DNS 服务器对 baidu.com 执行 type=A 的查询。

# 1、
nslookup

# 2、
server dns.baidu.com

# 3、
set ty=A

# 4、
baidu.com

结果:
在这里插入图片描述

5:其他

DNS 记录:

在这里插入图片描述

《10 most used Nslookup commands》:
https://www.cloudns.net/blog/10-most-used-nslookup-commands/

《nslookup命令详解》:
https://blog.youkuaiyun.com/xg_ren/article/details/80782338


兰生幽谷,不为莫服而不芳。舟在江海,不为莫乘而不浮。君子行义,不为莫知而止休。

——《淮南子》(西汉)刘安

Linux常用命令之nslookup命令详解 nslookup 是一个非常实用且强大的命令行工具,无论是日常的网络管理还是复杂的故障排查都能发挥作用。 阅读详情

相关推荐

Linux 中的 Nslookup 命令怎么使用?

Nslookup是一种用于查询DNS域名解析信息的命令行工具,在Linux操作系统中广泛应用于诊断和调试网络问题。本文介绍了Nslookup命令的基本用法和高级用法,以及其输出解析和使用示例,希望能够帮助读者更好地理解和使用Nslookup命令。

网络技术联盟站 1710

nslookup 入门命令详解

分享一下自己在做计网: 自顶向下这本书课后习题时的一些经验 以下命令会在 Mac (Linux适用) 和 Windows 下同时运行,或许能帮你解决一些疑惑 先做个简单的介绍吧,nslookup (全称 name server lookup) ,是一个在命令行界面下的网络工具,它有两种模式:交互 & 非交互,进入交互模式在命令行界面直接输入nslookup按回车,非交互模式则是后面跟上查询的域名或者IP地址按回车。一般来说,非交互模式适用于简单的单次查询,若需要多次查询,则交互模式更加适合,例如.

Hoper-J的博客 5万+

UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount()【已解决】

UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount()【已解决】

围炉夜敲的博客 1万+

nslookup(1) command

1.命令简介 nslookup(Name Server Lookup)是一种网络管理命令,用于从 DNS 服务器查询域名、IP或其他 DNS 记录信息。 nslookup 有两种工作模式,交互模式和非交互模式。在交互模式下,用户可以向域名服务器查询各类主机、域名的信息,或者输出域名中的主机列表。在非交互模式下,针对一个主机或域名仅仅获取特定的名称或所需信息。 进入交互模式有两种方式: (1)直接输入 nslookup 命令,不加任何参数,此时 nslookup 会连接到默认的域名服务器(/etc/resol

Doublelv 的博客专栏。 1万+

相控阵雷达仿真入门:TWS与TAS模式实战解析(附代码示例)

本文深入解析相控阵雷达仿真中的TWS(边搜索边跟踪)与TAS(搜索加跟踪)模式,提供实战代码示例和优化策略。通过简化模型设计和对象化建模,帮助开发者快速构建高效仿真系统,适用于军事推演和装备评估。文章涵盖核心逻辑、数据结构设计及性能优化技巧,提升仿真效率与准确性。

weixin_30687051的博客 453

Ansys口腔正畸有限元分析:从几何处理到接触设定的全流程解析

本文详细解析了Ansys在口腔正畸有限元分析中的全流程应用,从几何处理到接触设定,帮助医生精准预测牙齿移动趋势。通过有限元建模技术,可同时观察牙齿-牙周膜-牙槽骨的力学响应,显著提升矫治效果预测准确率。文章还分享了实用技巧和参数设置建议,适用于正畸医生和工程师。

weixin_30897233的博客 348

批量nslookup工具_在线nslookup工具和应用程序

批量nslookup工具nslookup is a tool used to resolve DNS name into IP address or IP address to DNS name. nslookup provides a lot of different features during DNS resolution. nslookup command features also ...

cunjiu9486的博客 3345

成功解决AttributeError: ‘ImageDraw‘ object has no attribute ‘textsize‘

​ 成功解决AttributeError: 'ImageDraw' object has no attribute 'textsize' 目录 解决问题 解决思路 解决方法 解决问题 AttributeError: 'ImageDraw' object has no attribute 'textsize' 解决思路 属性错误:'ImageDraw'对象没有属性'textsize' 解决方法 最新的Pillow 10.0.0 版本已经删除了这个函数,导致两个库(Pillow 、wordc

头部AI社区如有邀博主AI主题演讲请私信—心比天高,仗剑走天涯,保持热爱,奔赴向梦想!低调,专注,谦虚,自律,反思,成长,还算比较正能量的博主,公益免费传播…内心特别想在AI界做出一些可以推进历史进程影响力的技术(兴趣使然,有点小情怀,也有点使命感呀 4777

nslookup 命令详解

NSLOOKUP命令 关键词: NSLOOKUP命令 详解 网络命令 NSLOOKUP命令详解 Nslookup 是一个 监测网络中 DNS 服务器是否能正确实现域名解析的命令行工具。 它在 Windows NT/2000/XP 中均可使用 , 但在 Windows 98 中却没有集成这一个工具。   Nslookup 必须要安装了 TCP/IP 协议的网络环境之后才能使用。   现在网络中已经架

sagi的专栏 4051

YOLO11实战优化:长尾分布解决 | 引入Seesaw Loss配合YOLO11分类头,完美应对类别极其不平衡的现实业务场景

摘要: YOLO11在工业缺陷检测等长尾分布场景中面临尾部类别检测失效的问题,根源在于头部类别样本的负样本梯度压制了尾部类别的学习。传统方法如重采样、Focal Loss等效果有限。Seesaw Loss通过动态调整缓解因子和补偿因子,平衡类别间的梯度分布,结合YOLO11的解耦分类头、Anchor-Free设计和C2PSA/C3K2模块,显著提升尾部类别识别能力。文章详细解析了Seesaw Loss的数学原理,并提供了可直接集成到YOLO11的PyTorch实现代码,为长尾分布下的目标检测提供了实用解决方

2601_95807009的博客 252

DeerFlow 系列教程 第十六篇 | 实战案例一——用 DeerFlow 进行深度研究

在日常使用 AI Agent 时,最常见的需求之一就是对某个主题进行全面、系统的研究。多源信息采集——不能只依赖单次搜索,需要从多个角度搜索不同来源交叉验证——不同来源的信息需要相互印证,避免单一信源的偏差结构化输出——最终产出的不是零散的信息片段,而是有组织的研究报告传统做法是人工反复搜索、阅读、整理。传统手工研究: DeerFlow 深度研究:人工搜索 → 阅读页面 → 记笔记 提交研究主题│ │▼ ▼换关键词 → 再搜索 → 再阅读 ┌──────────────────┐。

weixin_43674738的博客 162

NSLOOKUP(Name Server Lookup)

NSLOOKUP(Name Server Lookup)是一个功能强大的网络命令行工具,主要用于查询DNS(域名系统)服务器,以获取与域名相关的信息。

MEGREZJQ的博客 1736

【系统架构设计师】预测试卷四:综合知识(75道选择题)

本文整理系统架构设计师考试高频考点,涵盖计算机系统基础、计算机网络、数据库、软件工程与UML四大模块,共28道典型题目。重点解析Cache局部性原理、RISC/CISC区别、TCP三次握手、B+树索引优势、CAP定理、螺旋模型特点等核心概念,并标注易错选项,帮助考生快速掌握解题思路。 关键词:系统架构、Cache、RISC、TCP、B+树、CAP定理、螺旋模型

数据知道的博客 544

nslookup

nslookup概述 nslookup 命令,是Linux里非常常用的网络命令,简而言之就是“查DNS信息用的”。 nslookup 用于查询DNS的记录,查询域名解析是否正常,在网络故障时用来诊断网络问题 通过 man nslookup 可以看到对于 nslookup 的官方解释是 "query Internet name servers interactively"。 安装nslookup [root@localhost ~]# dnf install bind-utils nsl

耶多✌ 7784

Python爬虫实战:爬取ETF基金持仓变化

在python复制编辑本文详细介绍了如何使用Python的Scrapy框架爬取ETF基金的持仓变化信息,包括项目的搭建、数据的提取与存储、以及数据的可视化分析。通过本项目,读者可以掌握基本的网页爬虫技术,并应用于实际的财经数据采集与分析中。

2201_76125261的博客 629

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

告别手动输入:NSLOOKUP自动化工具大比拼

最惊喜的是AI对话功能,遇到技术问题随时提问,能得到针对性很强的解决方案。现在处理同样的DNS检查工作,时间从原来的47分钟缩短到2分钟以内,效率提升超过95%。于是研究了几种自动化方案,发现效率提升不是一点半点,这里把实践过程分享给大家。对于相同的域名查询,优先使用缓存结果而非重复请求DNS服务器。建议有类似需求的朋友都可以试试这种自动化方案,特别是平台的一键部署功能,让工具能立即投入实际使用。这个版本已经能把50个域名的处理时间压缩到8分钟,但存在两个问题:无法处理查询超时,且所有域名必须串行执行。

BlackironLynx23的博客 662

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

用C#来实现NslookUP的功能

i++)trybreak;continue;i < 512;++i)j++)k++)i<qCount;++i)name = "";i < aCount;++i)

biyusr的专栏 910

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

DNS的解析过程——工具nslookup

域名与FQDN的区别 域名:xxxxx.com FQDN: www.xxxxx.com· (完全限定域名) 域名记录:A,Cname, 主机记录A (将一个域名解析到ip上) Cnmae 别名记录(将一个域名解析到另一个域名上) NS 域名服务器地址进行定义和注册(这个域的域名服务器的地址记录) MX 邮件交换记录(它会指向这个域的smtp的服务器地址) Ptr 通过ip地址反向解析域名...

qq_39686022的博客 3223

NSLOOKUP命令的使用方法

NSLOOKUP命令的使用方法 查询IP地址 nslookup最简单的用法是查询域名对应的IP地址,包括A记录、MX记录、NS记录CNAME记录。 查询A记录:nslookup域名 查询MX记录:nslookup-q=mx 域名 查询NS记录:nslookup-q=ns 域名 查询CNAME记录:nslookup域名 查询域名反向解析是否生效可以使用Windows下的nslookup命令 命令格式:nslookup-qa=ptrxxx.xxx.xxx.x...

tzjly的专栏 1736

nslookup指定服务器是什么命令,Nslookup命令

本词条缺少概述图,补充相关内容使词条更完整,还能快速升级,赶紧来编辑吧!NSLOOKUP是NT、2000中连接DNS服务器,查询域名信息的一个非常有用的命令,可以指定查询的类型,可以查到DNS记录的生存时间还可以指定使用哪个DNS服务器进行解释。在已安装TCP/IP协议的电脑上面均可以使用这个命令。主要用来诊断域名系统 (DNS) 基础结构的信息。外文名Nslookup命令实例查询163....

weixin_32208021的博客 1259

nslookup命令详解

帮助我们把域名转换成 IP 地址,或者反过来把 IP 地址解析成域名。如果 DNS 服务器有 PTR 记录,会返回该 IP 对应的主机名。:简单易用,Windows/Linux 都有,适合初学者。:功能更强大,输出更详细,常用于专业 DNS 调试。(确认某个 IP 对应的主机名,常用于日志分析)。:可以进入交互模式后再使用,或者直接命令行调用。:可选,如果不指定则使用系统默认的 DNS。(比如网站打不开,先看能否正确解析 IP)。:解析得到的 IP 地址(可能有多个)。:当前使用的 DNS 服务器。

jkzyx123的博客 1227

nslookup type值_nslookup查询

NSLookup可以指定查询的类型,可以查到DNS记录的生存时间还可以指定使用那个DNS服务器进行解释。如何用本地计算机查询DNS记录?打开命令提示符窗口(开始--运行---输入CMD--回车)nslookup的语法为 nslookup –qt=类型 目标域名(注意qt必须小写)类型主要有:A 地址记录(Ipv4)AAAA 地址记录(Ipv6)CNAME 别名记录HINFO 硬件配置记录,包括CP...

weixin_42352842的博客 153

nslookup工具的使用方法

  查询IP地址  nslookup最简单的用法就是查询域名对应的IP地址,包括A记录和CNAME记录,如果查到的是CNAME记录还会返回别名记录的设置情况。其用法是:  nslookup 域名  以下是A记录的返回情况。   nslookup命令会采用先反向解释获得使用的DNS服务器的名称,由于我这里使用的是一个内部的DNS服务器所以没有正确的反向记录,导致结果的前面几行出错。大家可以不必理会。

3815
上一篇: 《工具录》NetCat
下一篇: 《工具录》dig
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值