DNS解析工具使用案例

简介: 关于如何在Windows和Linux操作系统下使用DNS解析工具的案例,包括查看和清空DNS缓存、使用whois查询工具以及安装和使用dig工具进行DNS记录查询。

作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.Windows操作系统下是有DNS缓存记录的

1>.查看本地的DNS缓存信息

ipconfig /displaydns

2>.清空DNS缓存记录

ipconfig /flushdns

二.whois查询工具

1>.在CentOS操作系统下安装

[root@k8s101.yinzhengjie.com ~]# yum -y install whois
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.bfsu.edu.cn
 * updates: mirrors.huaweicloud.com
base                                                                                                                                                        | 3.6 kB  00:00:00     
extras                                                                                                                                                      | 2.9 kB  00:00:00     
updates                                                                                                                                                     | 2.9 kB  00:00:00     
正在解决依赖关系
--> 正在检查事务
---> 软件包 whois.x86_64.0.5.1.1-2.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

===================================================================================================================================================================================
 Package                                  架构                                      版本                                             源                                       大小
===================================================================================================================================================================================
正在安装:
 whois                                    x86_64                                    5.1.1-2.el7                                      base                                     72 k

事务概要
===================================================================================================================================================================================
安装  1 软件包

总下载量:72 k
安装大小:222 k
Downloading packages:
whois-5.1.1-2.el7.x86_64.rpm                                                                                                                                |  72 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : whois-5.1.1-2.el7.x86_64                                                                                                                                       1/1 
  验证中      : whois-5.1.1-2.el7.x86_64                                                                                                                                       1/1 

已安装:
  whois.x86_64 0:5.1.1-2.el7                                                                                                                                                       

完毕!
[root@k8s101.yinzhengjie.com ~]#

[root@k8s101.yinzhengjie.com ~]# yum -y install whois

2>.查询域名的归属者信息

[root@k8s101.yinzhengjie.com ~]# whois yinzhengjie.com
   Domain Name: YINZHENGJIE.COM
   Registry Domain ID: 2518910439_DOMAIN_COM-VRSN
   Registrar WHOIS Server: grs-whois.hichina.com
   Registrar URL: http://www.net.cn
   Updated Date: 2020-04-26T04:11:59Z
   Creation Date: 2020-04-26T04:04:26Z
   Registry Expiry Date: 2025-04-26T04:04:26Z
   Registrar: Alibaba Cloud Computing (Beijing) Co., Ltd.
   Registrar IANA ID: 420
   Registrar Abuse Contact Email: DomainAbuse@service.aliyun.com
   Registrar Abuse Contact Phone: +86.95187
   Domain Status: ok https://icann.org/epp#ok
   Name Server: DNS17.HICHINA.COM
   Name Server: DNS18.HICHINA.COM
   DNSSEC: unsigned
   URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of whois database: 2020-12-29T22:11:52Z <<<

For more information on Whois status codes, please visit https://icann.org/epp
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 registrations; the 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 facsimile; or (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.
[root@k8s101.yinzhengjie.com ~]#

[root@k8s101.yinzhengjie.com ~]# whois yinzhengjie.com

3>.

二.dig工具

1>.在Linux操作系统下安装dig工具

  CentOS Linux发行版本:  
    [root@dns53.yinzhengjie.com ~]# yum -y install bind-utils

  Ubuntu发行版本:
    [root@dns53.yinzhengjie.com ~]# apt-get -y install dnsutils

2>.使用默认的DNS服务器查询解析记录

[root@docker201.yinzhengjie.com ~]# dig www.baidu.com

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.3 <<>> www.baidu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32298
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 5, ADDITIONAL: 6

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.baidu.com.            IN    A

;; ANSWER SECTION:
www.baidu.com.        1176    IN    CNAME    www.a.shifen.com.
www.a.shifen.com.    278    IN    A    39.156.66.14
www.a.shifen.com.    278    IN    A    39.156.66.18

;; AUTHORITY SECTION:
a.shifen.com.        1176    IN    NS    ns2.a.shifen.com.
a.shifen.com.        1176    IN    NS    ns3.a.shifen.com.
a.shifen.com.        1176    IN    NS    ns4.a.shifen.com.
a.shifen.com.        1176    IN    NS    ns1.a.shifen.com.
a.shifen.com.        1176    IN    NS    ns5.a.shifen.com.

;; ADDITIONAL SECTION:
ns4.a.shifen.com.    1176    IN    A    14.215.177.229
ns5.a.shifen.com.    1176    IN    A    180.76.76.95
ns2.a.shifen.com.    1176    IN    A    220.181.33.32
ns3.a.shifen.com.    1176    IN    A    112.80.255.253
ns1.a.shifen.com.    1176    IN    A    110.242.68.42

;; Query time: 0 msec
;; SERVER: 172.200.1.53#53(172.200.1.53)
;; WHEN: 四 12月 31 22:02:34 CST 2020
;; MSG SIZE  rcvd: 271

[root@docker201.yinzhengjie.com ~]#

[root@docker201.yinzhengjie.com ~]# dig www.baidu.com

3>.查询NS记录

[root@docker201.yinzhengjie.com ~]# dig -t ns www.baidu.com

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.3 <<>> -t ns www.baidu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42792
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.baidu.com.            IN    NS

;; ANSWER SECTION:
www.baidu.com.        1006    IN    CNAME    www.a.shifen.com.

;; AUTHORITY SECTION:
a.shifen.com.        600    IN    SOA    ns1.a.shifen.com. baidu_dns_master.baidu.
com. 2012310014 5 5 2592000 3600
;; Query time: 15 msec
;; SERVER: 172.200.1.53#53(172.200.1.53)
;; WHEN: 四 12月 31 22:05:24 CST 2020
;; MSG SIZE  rcvd: 126

[root@docker201.yinzhengjie.com ~]#

[root@docker201.yinzhengjie.com ~]# dig -t ns www.baidu.com

目录
相关文章
|
人工智能 自然语言处理 Java
FastExcel:开源的 JAVA 解析 Excel 工具,集成 AI 通过自然语言处理 Excel 文件,完全兼容 EasyExcel
FastExcel 是一款基于 Java 的高性能 Excel 处理工具,专注于优化大规模数据处理,提供简洁易用的 API 和流式操作能力,支持从 EasyExcel 无缝迁移。
3442 65
FastExcel:开源的 JAVA 解析 Excel 工具,集成 AI 通过自然语言处理 Excel 文件,完全兼容 EasyExcel
|
12月前
|
机器学习/深度学习 人工智能 JSON
Resume Matcher:增加面试机会!开源AI简历优化工具,一键解析简历和职位描述并优化
Resume Matcher 是一款开源AI简历优化工具,通过解析简历和职位描述,提取关键词并计算文本相似性,帮助求职者优化简历内容,提升通过自动化筛选系统(ATS)的概率,增加面试机会。
1456 18
Resume Matcher:增加面试机会!开源AI简历优化工具,一键解析简历和职位描述并优化
|
11月前
|
存储 人工智能 API
离线VS强制登录?Apipost与Apifox的API工具理念差异深度解析
在代码开发中,工具是助手还是枷锁?本文通过对比Apipost和Apifox在断网环境下的表现,探讨API工具的选择对开发自由度的影响。Apifox强制登录限制了离线使用,而Apipost支持游客模式与本地存储,尊重开发者数据主权。文章从登录策略、离线能力、协作模式等方面深入分析,揭示工具背后的设计理念与行业趋势,帮助开发者明智选择,掌握数据控制权并提升工作效率。
|
NoSQL Java Linux
《docker高级篇(大厂进阶):2.DockerFile解析》包括:是什么、DockerFile构建过程解析、DockerFile常用保留字指令、案例、小总结
《docker高级篇(大厂进阶):2.DockerFile解析》包括:是什么、DockerFile构建过程解析、DockerFile常用保留字指令、案例、小总结
577 76
|
开发框架 .NET 中间件
.net8 使用 license 证书授权案例解析
本文介绍了如何使用 `.NET CLI` 创建并改造一个 `ASP.NET Core Web API` 项目,以实现基于许可证的授权机制。具体步骤包括创建项目、添加必要的 NuGet 包(如 `Standard.Licensing` 和 `Swashbuckle.AspNetCore`),以及修改 `Program.cs` 文件以集成自定义的许可证验证中间件。项目结构中新增了 `LicenseController` 接口用于处理授权相关操作,并通过测试流程验证了默认天气接口在未授权和授权状态下的响应情况。整个过程确保了应用程序能够在启动时正确验证许可证,保障系统的安全性与可控性。
585 9
.net8 使用 license 证书授权案例解析
|
数据采集 存储 调度
BeautifulSoup VS Scrapy:如何选择适合的HTML解析工具?
在Python网页抓取领域,BeautifulSoup和Scrapy是两款备受推崇的工具。BeautifulSoup易于上手、灵活性高,适合初学者和简单任务;Scrapy则是一个高效的爬虫框架,内置请求调度、数据存储等功能,适合大规模数据抓取和复杂逻辑处理。两者结合使用可以发挥各自优势,例如用Scrapy进行请求调度,用BeautifulSoup解析HTML。示例代码展示了如何在Scrapy中设置代理IP、User-Agent和Cookies,并使用BeautifulSoup解析响应内容。选择工具应根据项目需求,简单任务选BeautifulSoup,复杂任务选Scrapy。
346 1
BeautifulSoup VS Scrapy:如何选择适合的HTML解析工具?
|
12月前
|
数据可视化 测试技术 API
前后端分离开发:如何高效调试API?有工具 vs 无工具全解析
在前后端分离开发中,API调试至关重要。本文探讨有无调试工具时如何高效调试API,重点分析Postman、Swagger等工具优势及无工具代码调试方法。通过实际场景如用户登录接口,对比两者特性。同时介绍Apipost-Hepler(IDEA插件),将可视化与代码调试结合,提供全局请求头配置、历史记录保存等功能,优化团队协作与开发效率,助力API调试进入全新阶段。
|
12月前
|
JSON 监控 物联网
WebSocket 调试全攻略:核心解析、工具选择与对比!
WebSocket 是一种全双工、实时交互的网络通信协议,适用于即时通信、实时数据流、多人协作、IoT 等场景。调试 WebSocket 时,工具应具备握手管理、实时消息收发、自定义 Header、消息大小告警、分组管理、多连接支持和断线重现等功能。主流调试工具如 Postman、ApiPost 和 ApiFox 各有优劣:Postman 界面友好适合基础调试;ApiPost 支持高级功能如消息分组和自动重连;ApiFox 则强化了多连接支持。选择工具时需根据具体需求和团队熟悉度决定。
|
12月前
|
机器学习/深度学习 人工智能 搜索推荐
技术革新下的培训新趋势:案例解析
从最初的“试试看”,到如今的“非做不可”,企业培训已经成为央国企和上市公司不可或缺的战略环节。无论是AI与大模型的赋能,DeepSeek,还是具身智能、智算技术和数据科学的实战应用,这些课程都在为企业打开新的可能性。
|
数据可视化 测试技术 API
前后端分离开发:如何高效调试API?有工具 vs 无工具全解析
在前后端分离的开发模式中,API 调试的效率直接影响项目的质量和交付速度。通过本文的对比分析,我们可以看到无工具调试模式虽具备灵活性和代码复用能力,但在操作便利性和团队协作上稍显不足。而传统的外部调试工具带来了可视化、高效协作与扩展性,却可能存在工具切换带来的开发链路断层问题。Apipost-Hepler 融合了两者的优势,让开发者无需离开熟悉的 IDEA 环境,就能享受可视化调试工具的强大功能。
398 5

推荐镜像

更多
  • DNS