nslookup、arp、netstat、traceroute
nslookup
主要用于测试DNS服务器是否正常工作,除此之外,还可以对域名和IP地址进行查询。
[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服务器。
[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地址之间的转换。
[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 冗余模式
[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
用于显示网络的连接状态、查询路由表和对网络接口进行统计。
[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系统中的,路由表
[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
[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
用于检测到达目的地的路由状况
[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的更多相关文章
- MAC地址表、ARP缓存表、路由表及交换机、路由器基本原理
在网上找到了这篇讲述MAC地址,ARP协议和路由表的文章,如获至宝.一篇文章把组网中的相关概念讲的明明白白. 原文是发布在51cto博客上,但不知道为什么点进去却是404.让我没想到的是这个技术论坛上 ...
- DHCP协议格式、DHCP服务搭建、DHCP协商交互过程入门学习
相关学习资料 http://www.rfc-editor.org/rfc/rfc2131.txt http://baike.baidu.com/view/7992.htm?fromtitle=DHCP ...
- 1、网络并发编程--简介、软件开发架构、OSI七层协议
python复习 变量与常量 基本数据类型 内置方法 字符编码.文件操作 函数 函数参数.闭包函数.装饰器 面向对象 封装.继承.多态 """ 什么是对象 数据与功能的结 ...
- (转载)详解网络传输中的三张表,MAC地址表、ARP缓存表以及路由表
郑重声明:原文转载于http://dengqi.blog.51cto.com/5685776/1223132 向好文章致敬!!! 一:MAC地址表详解 说到MAC地址表,就不得不说一下交换机的工作原理 ...
- Windows-007-进程相关命令(netstat、tasklist、taskkill、tskill)实战实例图文详解
本节主要讲述 Windows 系统下,nestat.tasklist.tskill 三个 CMD 命令的参数,及使用方法:以及如何利用三者结合查看进程信息和结束进程.敬请亲们参阅,希望能对亲们有所帮助 ...
- linux常用命令--ps、netstat、find
一.ps 1.1ps命令简介 Linux中的ps命令是Process Status的缩写.ps命令用来列出系统中当前运行的那些进程.ps命令列出的是当前那些进程的快照,就是执行ps命令的那个时刻的那 ...
- 网络传输中的三张表,MAC地址表、ARP缓存表以及路由表
一:MAC地址表详解 说到MAC地址表,就不得不说一下交换机的工作原理了,因为交换机是根据MAC地址表转发数据帧的.在交换机中有一张记录着局域网主机MAC地址与交换机接口的对应关系的表,交换机就是根据 ...
- MAC地址表、ARP缓存表以及路由表
一:MAC地址表详解 说到MAC地址表,就不得不说一下交换机的工作原理了,因为交换机是根据MAC地址表转发数据帧的.在交换机中有一张记录着局域网主机MAC地址与交换机接口的对应关系的表,交换机就是根据 ...
- 详解网络传输中的三张表,MAC地址表、ARP缓存表以及路由表
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://dengqi.blog.51cto.com/5685776/1223132 一:M ...
- 【Linux笔记】ps、kill、netstat、nohup、screen
1.ps 命令,用于查看当前正在运行的进程,使用该命令可以确定有哪些进程正在运行和运行的状态.进程是否结束.进程有没有僵尸.哪些进程占用了过多的资源等等. 语法: ps [options] 示例: p ...
随机推荐
- 创建第一个UI
创建一个2D UI 制作UI时,首先要创建UI的"根".在Unity顶部NGUI菜单中选择Create,然后选择2D UI. 创建完成后,在Scene窗口中,NGUI自动生成了一个 ...
- jquery , find the event handler,找到jquery中的event handler
找到 dispatch: function (e) { e = b.event.fix(e); var n, r, i, s, o, u = [], a = d.call(arguments), f ...
- 1088-Gnome Sequencing
描述 In the book All Creatures of Mythology, gnomes are kind, bearded creatures, while goblins tend to ...
- ZOJ 3603 Draw Something Cheat
点我看题目 题意 : 给你n个字符串,让你找出在每个字符串中出现的字母,按字典序输出来. 思路 :一开始想差了,以为记录下每个字符出现次数,然后找次数大于1的,可是我忘了可能在一个字符串中有AA,而另 ...
- http://www.ruanyifeng.com/blog/2011/09/restful
http://www.ruanyifeng.com/blog/2011/09/restful
- 李洪强实现横向滚动的View<一>
今天做一个小的view的效果(纯代码),虽然这个view做起来 并不是很难,但是他是为后面我要实现的功能做一个铺垫. 01 创建CFTyreView,继承自UIView 02 来到.m文件. 2.1 ...
- Ubuntu nfs 配置
1. nfs server端的安装和配置 (1)安装nfs server sudo apt-get install nfs-kernel-server nfs-common (2)重启nfs serv ...
- cyg_flag 系列函数
http://blog.csdn.net/mrwangwang/article/details/7954236 cyg_flag_init Name: cyg_flag_init ( ) - init ...
- comm命令——
comm命令 :对已经有序的文件进行比较——第一列只在文件1中出现的文件,第二列只在文件2中出现的文件,第三列在文件1和文件2中同事出现的文件 请注意前提条件: comm对文件 ...
- Java多态的体现之接口
/** * * @author Administrator * 功能:接口体现多态 */ package com.test4; public class Test { public static vo ...