Linux命令(36):nslookup命令-域名查询工具

本文涉及的产品
.cn 域名,1个 12个月
简介:

nslookup命令


功能说明

nslookup命令,在Windows、Linux下常用的网络命令,可用来查询或诊断域名系统(DNS)的信息。

linux下域名查询的工具有nsloouup、dig、host

Centos7,由于使用最小安装,默认没有带该命令,下面是安装命令演示:

[root@c7 ~]# nslookup                         #提示没有找到命令

-bash: nslookup: 未找到命令

[root@c7 ~]# yum  provides  */nslookup        #查询nslookup使用哪个软件包

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirrors.neusoft.edu.cn

 * extras: mirrors.tuna.tsinghua.edu.cn

 * updates: mirrors.tuna.tsinghua.edu.cn          #查询到是使用bind-utils软件包

32:bind-utils-9.9.4-29.el7.x86_64 : Utilities for querying DNS name servers

源    :base

匹配来源:

文件名    :/usr/bin/nslookup

[root@c7 ~]# yum -y install bind-utils        #安装该bind-utils软件包

[root@c7 ~]# nslookup

www.baidu.com

Server:         219.141.140.10

Address:        219.141.140.10#53


Non-authoritative answer:

www.baidu.com   canonical name = www.a.shifen.com.

Name:   www.a.shifen.com

Address: 220.181.112.244

Name:   www.a.shifen.com

Address: 220.181.111.188

示例

    截取其中服务器的IP地址

[root@rsync01 shell]# nslookup z.cn                                       

Server:         114.114.114.114

Address:        114.114.114.114#53


Non-authoritative answer:

Name:   z.cn

Address: 54.222.60.252


[root@rsync01 shell]# nslookup z.cn | tail -2 | head -1 | awk '{print $2}'

54.222.60.252

[root@rsync01 shell]#






      本文转自cix123  51CTO博客,原文链接:http://blog.51cto.com/zhaodongwei/1881036,如需转载请自行联系原作者




相关文章
|
9天前
|
Linux Shell 开发工具
|
5天前
|
Linux
|
9天前
|
网络协议 安全 Linux
|
7天前
|
存储 运维 Linux
|
7天前
|
存储 JSON Linux
|
8天前
|
存储 安全 Ubuntu
Linux dump命令教程
绍了Linuxdump命令的功能,包括用于备份整个文件系统的全备份和增量备份,以及如何在不同Linux发行版中安装和使用dump命令。
45 16
|
4天前
|
Linux
《解析 Linux 命令:systemd-delta》
`systemd-delta`: 解析Linux服务配置差异。概览: 显示服务单元文件与默认配置的对比,助于配置问题排查与系统审计。特点: 清晰展示修改点,涵盖启动选项等。示例: `systemd-delta [--plain] <service>`. 注意: 理解默认配置,谨慎修改,定期检查。掌握此命令,深化系统服务配置洞察,优化Linux管理。#Linux #systemd-delta
|
4天前
|
运维 监控 Linux
深入了解 Linux 命令:systemd-cgtop
`systemd-cgtop`, 实时监控 Linux cgroup 资源使用的关键工具。它动态显示 CPU、内存、IO 等数据,支持实时更新与多维展示。常用参数 `-n` 限定行数,`-p` 按属性排序。结合 `grep` 可监控特定进程,如 `systemd-cgtop | grep 1234`。排序与限制输出: `systemd-cgtop -p memory -n 5`。最佳实践包括熟悉 cgroup 架构,整合其他监控工具,定期检查以预防资源瓶颈。掌握 `systemd-cgtop` 助力性能优化与管理。
|
4天前
|
存储 NoSQL Linux
《探索 Linux 命令:systemd-coredumpctl》
**《systemd-coredumpctl概览》** `systemd-coredumpctl`, Linux中管理&分析core dump的利器。集中管控systemd生成的转储,详述crash细节。用`--list`查看所有转储,`--info <ID>`深入单一转储。需注意权限、存储管理,配gdb深化分析。精通此命令,加速问题诊断。#LinuxTips #CoreDumpAnalysis
|
8天前
|
网络协议 Ubuntu Linux