nslookup、arp、netstat、traceroute

时间:2022-09-17 22:25:24

nslookup

  主要用于测试DNS服务器是否正常工作,除此之外,还可以对域名和IP地址进行查询。

nslookup、arp、netstat、traceroute

[root@weekend110 ~]# nslookup
> www.guet.edu.cn        输入待查询的域名  www.guet.edu.cn
Server: 192.168.80.2
Address: 192.168.80.2#53

以上为所使用的DNS服务器

Non-authoritative answer:
Name: www.guet.edu.cn
Address: 202.193.64.56
Name: dns.guet.edu.cn
Address: 202.103.243.112
Name: mango.guet.edu.cn
Address: 202.193.64.33
> 202.193.64.33      输入待查询的IP地址
Server: 192.168.80.2
Address: 192.168.80.2#53

以上为所使用的DNS服务器

Non-authoritative answer:
33.64.193.202.in-addr.arpa name = 33.64.193.202.in-addr.arpa.
33.64.193.202.in-addr.arpa name = mango.gliet.cn.
33.64.193.202.in-addr.arpa name = mango.gliet.edu.cn.

Authoritative answers can be found from:
193.202.in-addr.arpa nameserver = dns.gliet.cn.
193.202.in-addr.arpa nameserver = mango.gliet.cn.
dns.gliet.cn internet address = 202.103.243.112
mango.gliet.cn internet address = 202.193.64.33
> exit      退出nslookup命令环境

[root@weekend110 ~]#

  也可以,不进入nslookup命令交互模式,直接使用命令查询IP地址或域名使用的DNS服务器。

nslookup、arp、netstat、traceroute

[root@weekend110 ~]# nslookup www.guet.edu.cn
Server: 192.168.80.2
Address: 192.168.80.2#53

Non-authoritative answer:
Name: www.guet.edu.cn
Address: 202.193.64.56
Name: dns.guet.edu.cn
Address: 202.103.243.112
Name: mango.guet.edu.cn
Address: 202.193.64.33

[root@weekend110 ~]# nslookup 202.193.64.33        查询IP地址为202.193.64.33的服务器的域名
Server: 192.168.80.2
Address: 192.168.80.2#53

Non-authoritative answer:
33.64.193.202.in-addr.arpa name = 33.64.193.202.in-addr.arpa.
33.64.193.202.in-addr.arpa name = mango.gliet.cn.
33.64.193.202.in-addr.arpa name = mango.gliet.edu.cn.

Authoritative answers can be found from:
193.202.in-addr.arpa nameserver = mango.gliet.cn.
193.202.in-addr.arpa nameserver = dns.gliet.cn.
dns.gliet.cn internet address = 202.103.243.112
mango.gliet.cn internet address = 202.193.64.33

[root@weekend110 ~]# nslookup 202.193.64.56
Server: 192.168.80.2
Address: 192.168.80.2#53

Non-authoritative answer:
56.64.193.202.in-addr.arpa name = 56.64.193.202.in-addr.arpa.

Authoritative answers can be found from:
193.202.in-addr.arpa nameserver = dns.gliet.cn.
193.202.in-addr.arpa nameserver = mango.gliet.cn.
dns.gliet.cn internet address = 202.103.243.112
mango.gliet.cn internet address = 202.193.64.33

[root@weekend110 ~]#

 arp

  arp可以实现,从IP地址到以太网MAC地址之间的转换。

nslookup、arp、netstat、traceroute

[root@weekend110 ~]# man arp
ARP(8) Linux Programmer’s Manual ARP(8)

NAME
arp - manipulate the system ARP cache

SYNOPSIS
arp [-evn] [-H type] [-i if] -a [hostname]

arp [-v] [-i if] -d hostname [pub]

arp [-v] [-H type] [-i if] -s hostname hw_addr [temp]

arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub

arp [-v] [-H type] [-i if] -Ds hostname ifa [netmask nm] pub

arp [-vnD] [-H type] [-i if] -f [filename]

NOTE
This program is obsolete. For replacement check ip neighbor.

DESCRIPTION
Arp manipulates the kernel’s ARP cache in various ways. The primary options are clearing an address mapping
entry and manually setting up one. For debugging purposes, the arp program also allows a complete dump of the
ARP cache.

OPTIONS
-v, --verbose
Tell the user what is going on by being verbose.

-n, --numeric

arp -a        以BSD默认格式显示arp表中的所有记录项

arp -e        以linux默认格式显示arp表中的所有记录项

arp -s         设置一个新的arp记录项

arp -d        删除一个arp记录项

arp -i        指定网络接口

arp -f         从指定文件中读取新的记录项

arp -v        冗余模式

nslookup、arp、netstat、traceroute

[root@weekend110 ~]# arp -a      
? (192.168.80.2) at 00:50:56:f4:e1:51 [ether] on eth0
WIN-BQOBV63OBNM (192.168.80.1) at 00:50:56:c0:00:08 [ether] on eth0
[root@weekend110 ~]# arp -e
Address HWtype HWaddress Flags Mask Iface
192.168.80.2 ether 00:50:56:f4:e1:51 C eth0
WIN-BQOBV63OBNM ether 00:50:56:c0:00:08 C eth0
[root@weekend110 ~]#

netstat

  用于显示网络的连接状态、查询路由表和对网络接口进行统计。

nslookup、arp、netstat、traceroute

[root@weekend110 ~]# man netstat
NETSTAT(8) Linux Programmer’s Manual NETSTAT(8)

NAME
netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast
memberships

SYNOPSIS
netstat [address_family_options] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a] [--numeric|-n]
[--numeric-hosts][--numeric-ports][--numeric-ports] [--symbolic|-N] [--extend|-e[--extend|-e]] [--timers|-o]
[--program|-p] [--verbose|-v] [--continuous|-c] [delay]

netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--numeric|-n]
[--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay]

netstat {--interfaces|-I|-i} [iface] [--all|-a] [--extend|-e] [--verbose|-v] [--program|-p] [--numeric|-n]
[--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay]

netstat {--groups|-g} [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c]
[delay]

netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports]
[--continuous|-c] [delay]

netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w] [delay]

netstat {--version|-V}

netstat {--help|-h}

address_family_options:

[--protocol={inet,inet6,unix,ipx,ax25,netrom,ddp, ... } ] [--unix|-x] [--inet|--ip] [--ax25] [--ipx] [--netrom]
[--ddp]

NOTE
This program is obsolete. Replacement for netstat is ss. Replacement for netstat -r is ip route. Replacement

netstat -r      显示核心路由表

netstat -g      显示多播组成员信息

netstat -c      进行动态显示,每隔1秒更新1次

netstat -p      显示每个socket所属的进程号和程序名

netstat -l      显示所有处于侦听模式的socket

netstat -a       显示所有的socket,无论其是否处于侦听状态

netstat -n      以IP地址形式(即数字格式)进行显示

  查看当前linux系统中的,路由表

nslookup、arp、netstat、traceroute

[root@weekend110 ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.80.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
default 192.168.80.2 0.0.0.0 UG 0 0 0 eth0
[root@weekend110 ~]#

  查看当前linux系统中所有处于侦听状态的socket

nslookup、arp、netstat、traceroute

[root@weekend110 ~]# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:42011 *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:36611 *:* LISTEN
udp 0 0 *:sunrpc *:*
udp 0 0 *:dec_dlm *:*
udp 0 0 *:ipp *:*
udp 0 0 *:vacdsm-app *:*
udp 0 0 *:57815 *:*
udp 0 0 *:sunrpc *:*
udp 0 0 *:dec_dlm *:*
udp 0 0 *:45438 *:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 14040 public/cleanup
unix 2 [ ACC ] STREAM LISTENING 13165 /var/run/cups/cups.sock
unix 2 [ ACC ] STREAM LISTENING 13232 /var/run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 14204 /var/run/abrt/abrt.socket
unix 2 [ ACC ] STREAM LISTENING 17430 /tmp/orbit-root/linc-7d0-0-4bd6383e5553e
unix 2 [ ACC ] STREAM LISTENING 16499 /tmp/keyring-8HHVIm/socket
unix 2 [ ACC ] STREAM LISTENING 17537 /tmp/orbit-root/linc-7db-0-7588364fa30
unix 2 [ ACC ] STREAM LISTENING 19412 /tmp/orbit-root/linc-8e5-0-721f687210c51
unix 2 [ ACC ] STREAM LISTENING 17602 /tmp/orbit-root/linc-7ed-0-5e98d0f082c23
unix 2 [ ACC ] STREAM LISTENING 19149 /tmp/orbit-root/linc-827-0-332326bc39787
unix 2 [ ACC ] STREAM LISTENING 17679 /tmp/orbit-root/linc-7f0-0-7172996f4d82
unix 2 [ ACC ] STREAM LISTENING 17318 /tmp/keyring-8HHVIm/socket.ssh
unix 2 [ ACC ] STREAM LISTENING 9291 @/com/ubuntu/upstart
unix 2 [ ACC ] STREAM LISTENING 17803 /tmp/orbit-root/linc-7f8-0-6c7fd4bd93072
unix 2 [ ACC ] STREAM LISTENING 17808 /tmp/orbit-root/linc-7f7-0-7a6b30919fbd0
unix 2 [ ACC ] STREAM LISTENING 18113 /tmp/orbit-root/linc-812-0-7eebc3b381f7
unix 2 [ ACC ] STREAM LISTENING 18127 /tmp/orbit-root/linc-810-0-5dede9ea43407
unix 2 [ ACC ] STREAM LISTENING 18147 /tmp/orbit-root/linc-814-0-27515ff3110f1
unix 2 [ ACC ] STREAM LISTENING 18169 /tmp/orbit-root/linc-80f-0-396353431195e
unix 2 [ ACC ] STREAM LISTENING 18810 /tmp/orbit-root/linc-7ee-0-5b99b8d7edc48
unix 2 [ ACC ] STREAM LISTENING 14047 private/tlsmgr
unix 2 [ ACC ] STREAM LISTENING 19087 /tmp/orbit-root/linc-81d-0-42129c74b7757
unix 2 [ ACC ] STREAM LISTENING 14051 private/rewrite
unix 2 [ ACC ] STREAM LISTENING 19058 /tmp/orbit-root/linc-82b-0-533037353012d
unix 2 [ ACC ] STREAM LISTENING 18913 /tmp/orbit-root/linc-81a-0-7112e73a1f025
unix 2 [ ACC ] STREAM LISTENING 19025 /tmp/orbit-root/linc-84c-0-66c382f0c6b3f
unix 2 [ ACC ] STREAM LISTENING 13276 @/var/run/hald/dbus-dBCYzUv7ZV
unix 2 [ ACC ] STREAM LISTENING 19167 /tmp/orbit-root/linc-822-0-51dd63b7702ba
unix 2 [ ACC ] STREAM LISTENING 20387 /tmp/orbit-root/linc-996-0-79704b5eac021
unix 2 [ ACC ] STREAM LISTENING 19192 /tmp/orbit-root/linc-82d-0-32d7b94d98dd8
unix 2 [ ACC ] STREAM LISTENING 20501 /tmp/orbit-root/linc-9a6-0-72a6389f1b80
unix 2 [ ACC ] STREAM LISTENING 17297 /tmp/orbit-root/linc-7c8-0-6c211c5c709ed
unix 2 [ ACC ] STREAM LISTENING 14935 @/tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 17314 /tmp/orbit-root/linc-76b-0-522d509a82410
unix 2 [ ACC ] STREAM LISTENING 13269 @/var/run/hald/dbus-5pt50VnGon
unix 2 [ ACC ] STREAM LISTENING 17320 /tmp/keyring-8HHVIm/socket.pkcs11
unix 2 [ ACC ] STREAM LISTENING 14936 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 15293 @/tmp/gdm-session-PjeRYypV
unix 2 [ ACC ] STREAM LISTENING 14055 private/bounce
unix 2 [ ACC ] STREAM LISTENING 14059 private/defer
unix 2 [ ACC ] STREAM LISTENING 16904 /tmp/orbit-root/linc-7c4-0-38b3482d4e5c7
unix 2 [ ACC ] STREAM LISTENING 16776 @/tmp/dbus-HJiBk8d8vI
unix 2 [ ACC ] STREAM LISTENING 14063 private/trace
unix 2 [ ACC ] STREAM LISTENING 17142 /tmp/orbit-root/linc-775-0-2edd1e56f3e7
unix 2 [ ACC ] STREAM LISTENING 15122 @/tmp/gdm-greeter-XLcQAHNj
unix 2 [ ACC ] STREAM LISTENING 18948 /tmp/.esd-0/socket
unix 2 [ ACC ] STREAM LISTENING 18951 /root/.pulse/af81270238cf72a12c7e89bc0000003d-runtime/native
unix 2 [ ACC ] STREAM LISTENING 14067 private/verify
unix 2 [ ACC ] STREAM LISTENING 14071 public/flush
unix 2 [ ACC ] STREAM LISTENING 14075 private/proxymap
unix 2 [ ACC ] STREAM LISTENING 14079 private/proxywrite
unix 2 [ ACC ] STREAM LISTENING 14083 private/smtp
unix 2 [ ACC ] STREAM LISTENING 14087 private/relay
unix 2 [ ACC ] STREAM LISTENING 14091 public/showq
unix 2 [ ACC ] STREAM LISTENING 14095 private/error
unix 2 [ ACC ] STREAM LISTENING 14099 private/retry
unix 2 [ ACC ] STREAM LISTENING 14103 private/discard
unix 2 [ ACC ] STREAM LISTENING 14107 private/local
unix 2 [ ACC ] STREAM LISTENING 14111 private/virtual
unix 2 [ ACC ] STREAM LISTENING 14115 private/lmtp
unix 2 [ ACC ] STREAM LISTENING 14119 private/anvil
unix 2 [ ACC ] STREAM LISTENING 14123 private/scache
unix 2 [ ACC ] STREAM LISTENING 16880 /tmp/.ICE-unix/1909
unix 2 [ ACC ] STREAM LISTENING 12587 /var/run/rpcbind.sock
unix 2 [ ACC ] STREAM LISTENING 16879 @/tmp/.ICE-unix/1909
unix 2 [ ACC ] STREAM LISTENING 12668 /var/run/dbus/system_bus_socket
[root@weekend110 ~]#

traceroute

  用于检测到达目的地的路由状况

nslookup、arp、netstat、traceroute

[root@weekend110 ~]# traceroute -n www.guet.edu.cn
traceroute to www.guet.edu.cn (202.193.64.56), 30 hops max, 60 byte packets
1 192.168.80.2 0.175 ms 0.084 ms 0.132 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
8 * * *
9 * * *
10 * * *
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * *^C
[root@weekend110 ~]#

nslookup、arp、netstat、traceroute的更多相关文章

  1. MAC地址表、ARP缓存表、路由表及交换机、路由器基本原理

    在网上找到了这篇讲述MAC地址,ARP协议和路由表的文章,如获至宝.一篇文章把组网中的相关概念讲的明明白白. 原文是发布在51cto博客上,但不知道为什么点进去却是404.让我没想到的是这个技术论坛上 ...

  2. DHCP协议格式、DHCP服务搭建、DHCP协商交互过程入门学习

    相关学习资料 http://www.rfc-editor.org/rfc/rfc2131.txt http://baike.baidu.com/view/7992.htm?fromtitle=DHCP ...

  3. (转载)详解网络传输中的三张表,MAC地址表、ARP缓存表以及路由表

    郑重声明:原文转载于http://dengqi.blog.51cto.com/5685776/1223132 向好文章致敬!!! 一:MAC地址表详解 说到MAC地址表,就不得不说一下交换机的工作原理 ...

  4. Windows-007-进程相关命令(netstat、tasklist、taskkill、tskill)实战实例图文详解

    本节主要讲述 Windows 系统下,nestat.tasklist.tskill 三个 CMD 命令的参数,及使用方法:以及如何利用三者结合查看进程信息和结束进程.敬请亲们参阅,希望能对亲们有所帮助 ...

  5. linux常用命令--ps、netstat、find

     一.ps 1.1ps命令简介 Linux中的ps命令是Process Status的缩写.ps命令用来列出系统中当前运行的那些进程.ps命令列出的是当前那些进程的快照,就是执行ps命令的那个时刻的那 ...

  6. 网络传输中的三张表,MAC地址表、ARP缓存表以及路由表

    一:MAC地址表详解 说到MAC地址表,就不得不说一下交换机的工作原理了,因为交换机是根据MAC地址表转发数据帧的.在交换机中有一张记录着局域网主机MAC地址与交换机接口的对应关系的表,交换机就是根据 ...

  7. MAC地址表、ARP缓存表以及路由表

    一:MAC地址表详解 说到MAC地址表,就不得不说一下交换机的工作原理了,因为交换机是根据MAC地址表转发数据帧的.在交换机中有一张记录着局域网主机MAC地址与交换机接口的对应关系的表,交换机就是根据 ...

  8. 详解网络传输中的三张表,MAC地址表、ARP缓存表以及路由表

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://dengqi.blog.51cto.com/5685776/1223132 一:M ...

  9. 【Linux笔记】ps、kill、netstat、nohup、screen

    1.ps 命令,用于查看当前正在运行的进程,使用该命令可以确定有哪些进程正在运行和运行的状态.进程是否结束.进程有没有僵尸.哪些进程占用了过多的资源等等. 语法: ps [options] 示例: p ...

  10. dhcp snooping、ARP防护、

    应用场景 无线客户端流动性很大和不确定,比如在外来人员比较多的地方:广场.大厅.会议室和接待室等等.使用该方案可以有效地避免因为无线端出现私设IP地址导致地址冲突或者客户端中ARP病毒发起ARP攻击的 ...

随机推荐

  1. [ASP.NET MVC 小牛之路]11 - Filter

    Filter(筛选器)是基于AOP(面向方面编程)的设计,它的作用是对MVC框架处理客户端请求注入额外的逻辑,以非常简单优美的方式实现横切关注点(Cross-cutting Concerns).横切关 ...

  2. python学习道路(day7note)(subprocess模块,面向对象)

    1.subprocess模块   因为方法较多我就写在code里面了,后面有注释 #!/usr/bin/env python #_*_coding:utf-8_*_ #linux 上调用python脚 ...

  3. c#中SqlHelper类的编写(三)

    下面我们直接用可变长度参数的方式写一个完整的SqlHelper增删改public static int ExecuteNonQuery(string sql,params Parameter[] pa ...

  4. 新手入门 acm 输入输出练习

    A + B Problem(1000) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  5. css选择器基本属性

    选择器一,相邻选择器: 1,相邻选择器 1),定义:相邻选择器匹配指定元素的相邻兄弟元素 2),用法:如果需要选择紧接在另一个元素后的元素,而且二者有相同的父元素,可以使用相邻兄弟选择器 3),表示符 ...

  6. 没有dev-server.js文件,如何进行后台数据模拟?

    最新的vue-webpack-template 中已经去掉了dev-server.js 但是要进行模拟后台数据的,如何模拟本地数据操作? 解决方法: dev-server.js 改用webpack-d ...

  7. js 控制 class 类名(classList) 和 自定义属性(dataset)

    classList 用法: const div = document.querySelector('div') div.classList.add('myclass') // 添加类名 div.cla ...

  8. WPF 故事版例子

    Storyboard std = new Storyboard(); DoubleAnimation a = new DoubleAnimation(); a.From =0; a.To =400; ...

  9. python-Tkinter整理总结

    笔者学习Tkinter模块也有好久时间了,现将学习的做以整理. tkinter简介(一) tkinter中lable标签控件(二) tkinter中button按钮控件(三) tkinter中entr ...

  10. Kudu-java数据库简单操作

    参考官网:http://kudu.apache.org/docs/kudu_impala_integration.html 参考:https://my.oschina.net/weiqingbin/b ...