当前位置:   article > 正文

nslookup命令常见用法_nslookup txt

nslookup txt

nslookup命令常见用法

https://www.linuxcool.com/nslookup
https://wangchujiang.com/linux-command/c/nslookup.html


ip地址反查主机名

# Windows的ip反查命令
nbtstat -A ip #-A必须是大写

# Linux的命令
nmblookup -A #如果主机是Linux,不会显示主机名

# 安装nbtscan
sudo apt install -y nbtscan

# 如果主机是Linux,不会显示主机名
nbtscan ip 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

LocalDNS查看解析结果

# 使用本地的默认dns查询域名解析
nslookup 域名
  • 1
  • 2

在这里插入图片描述


公共DNS查看解析结果

# 使用公共DNS查看解析结果
nslookup 域名 114.114.114.114
  • 1
  • 2

使用指定权威dns解析域名

权威DNS可以在whois中查到

# 使用指定dns解析域名
# nslookup 域名 指定权威dns地址
nslookup google.com 1.1.1.1
  • 1
  • 2
  • 3

在这里插入图片描述


使用whois命令查询权威dns

https://blog.csdn.net/omaidb/article/details/128832814

Ubuntu版的whois命令比较好用,Centos版的whois某些网站信息会查不到.
Linuxwhois命令参数: https://wangchujiang.com/linux-command/c/jwhois.html

# Debian/Ubuntu
## 不安装libsocket-getaddrinfo-perl包会导致部分网站信息查不出来
apt install whois libsocket-getaddrinfo-perl -y

# Centos7/RHEL7
yum install -y whois perl-Socket-GetAddrInfo

# 查看网站注册信息
whois baidu.com
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

查询域名的IPV6地址

-ty=AAAA选项表示查询AAAA记录类型,即IPv6地址记录类型

# 查询域名的IPv6地址
nslookup -ty=AAAA google.com 1.1.1.1
  • 1
  • 2

在这里插入图片描述


使用TCP协议进行查询

# -vc 使用TCP协议进行查询
# -ty=A 只查看A记录,也就是IPV4
nslookup -vc -ty=A google.com 1.1.1.1
  • 1
  • 2
  • 3

在这里插入图片描述


使用指定dns端口查询

例如:opendns就开放了5353端口

  • 208.67.222.222
  • 208.67.220.220
# 使用指定端口查询
nslookup -port=5353 baidu.com 208.67.222.222
  • 1
  • 2

在这里插入图片描述


反查IP对应的域名

# 反查IP对应的域名
nslookup ip地址
nslookup ip地址 指定DNS地址
  • 1
  • 2
  • 3

在这里插入图片描述

# 反查IP对应的域名
host IP地址

host IP地址 指定DNS地址
  • 1
  • 2
  • 3
  • 4

在这里插入图片描述


检查txt记录是否生效

# nslookup检查txt值是否生效
nslookup -qt=TXT _acme-challenge.xxx.com

# 如果超时就解析失败
# 如果有txt值返回,就解析成功
  • 1
  • 2
  • 3
  • 4
  • 5

查询mx记录nslookup -type=mx

查邮件mx解析

nslookup -type=mx aliyun.com
[cesu-c8 root ~]# nslookup -type=mx aliyun.com
Server:         100.100.2.136
Address:        100.100.2.136#53
aliyun.com      mail exchanger = 10 mx2.mail.aliyun.com.
  • 1
  • 2
  • 3
  • 4
  • 5

查询域名下绑定的所有记录nslookup -type=any

nslookup -type=any qq.com
[cesu-c8 root ~]# nslookup -type=any qq.com
Server:         100.100.2.136
Address:        100.100.2.136#53

Non-authoritative answer:
qq.com  mail exchanger = 10 mx3.qq.com.
qq.com  mail exchanger = 20 mx2.qq.com.
qq.com  mail exchanger = 30 mx1.qq.com.
Name:   qq.com
Address: 203.205.254.157
Name:   qq.com
Address: 183.3.226.35
Name:   qq.com
Address: 123.151.137.18
Name:   qq.com
Address: 61.129.7.47
qq.com  nameserver = ns4.qq.com.
qq.com  nameserver = ns1.qq.com.
qq.com  nameserver = ns3.qq.com.
qq.com  nameserver = ns2.qq.com.

Authoritative answers can be found from:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/811089
推荐阅读
相关标签
  

闽ICP备14008679号