长城宽带网络检测最常用到的DOS命令

来源:百度文库 编辑:神马文学网 时间:2024/04/20 03:11:04
在长城宽带这么些年,是该总结下。
1.ipconfig 命令
IPconfig命令用于显示当前的TCP/IP配置的设置值。这些信息一般用来检验人工配置的TCP/IP设置是否正确。
Ipconfig命令常用参数
Ipconfig /all:显示本机TCP/IP配置的详细信息。
Ipconfig /release:DHCP客户端手工释放IP地址。
Ipconfig /renew:DHCP客户端手工向服务器刷新请求。
Ipconfig /flushdns:清除本地DNS缓存内容。
Ipconfig /displaydns:显示本地DNS内容。
Ipconfig /registerdns:DNS客户端手工向服务器进行注册。
Ipconfig /showclassid:显示网络适配器的DHCP类别信息。
Ipconfig /setclassid:设置网络适配器的DHCP类别。
Ipconfig /renew"Local Area Connection":
更新本地连接适配器的由DHCP分配IP地址的配置。
Ipconfig /showclassid Local*:显示名称以Local开头的所有适配器的DHCP类别ID。
Ipconfig /setclassid "Local Area Connection"TEST:将本地连接适配器的DHCP类别ID设置为TEST。
最常用的参数:all
例如:ipconfig/all 这个命令主要用于查看本地IP,MAC,DNS等信息。
2.ping 命令
Ping (Packet Internet Grope),因特网包探索器,用于测试网络连接量的程序。Ping发送一个ICMP回声请求消息给目的地并报告是否收到所希望的ICMP回声应答。
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
[-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
[-M mtu discovery hint] [-S sndbuf]
[ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
最常用参数  -t
这个命令主要用来测试主机与长城宽带核心设备的网络连接情况。用于测试三层以下网络是否正常。
例如:ping -t 172.16.253.1
如果用户有用路由器的话,可能需要ping一下路由器的网关
例如:ping -t 192.168.1.1
Ping命令各类反馈信息
在使用Ping命令时,通常会反馈Request timed out、Destination host Unreachable等信息,下面详细介绍使用Ping命令后反馈的主要信息说明。
Request timed out:对方已关机;对方与自己不在同一网段内,通过路由也无法找到对方;设置了ICMP数据包过滤;错误设置IP地址。
Destination host Unreachable:对方与本机不在同一网段内,而本机又未设置默认的路由,例如上例中A机中不设定默认的路由,运行Ping命令就会出现Destination host Unreachable。
destination host unreachable和time out的区别在于如果所经过的路由器的路由表中具有到达目标的路由,而目标因为其他原因不可到达,这时候会显示time out,如果路由表中连到达目标的路由都没有,那就会显示destination host unreachable。
Bad IP address:没有连接到DNS服务器,所以无法解析这个IP地址,也可能是IP地址不存在。
Source quench received:表示对方或中途的服务器繁忙无法回应。
Unknown host(不知名主机):该远程主机的名字不能被域名服务器(DNS)转换成IP地址。故障原因可能是域名服务器有故障,或者名字不正确,或者网络管理员的系统与远程主机之间的通信线路有故障。
No answer(无响应):说明本地系统有一条通向中心主机的路由,但却接收不到它发给该中心主机的任何信息。故障原因可能是中心主机没有工作、本地或中心主机网络配置不正确、本地或中心的路由器没有工作、通信线路有故障、中心主机存在路由选择问题。
no rout to host:网卡工作不正常。
transmit failed,error code:10043网卡驱动不正常。
unknown host name:DNS配置错误。
3.tracert 命令
Tracert(跟踪路由)是路由跟踪实用程序,用于确定 IP 数据报访问目标所采取的路径。Tracert 命令用 IP 生存时间 (TTL) 字段和 ICMP 错误消息来确定从一个主机到网络上其他主机的路由。
Usage:
tracert [ -46dFITnreAUV ] [ -f first_ttl ] [ -g gate,... ] [ -i device ] [ -m max_ttl ] [ -N squeries ] [ -p port ] [ -t tos ] [ -l flow_label ] [ -w waittime ] [ -q nqueries ] [ -s src_addr ] [ -z sendwait ] host [ packetlen ]
最常用参数 -d
这个命令主要用来测试主机到目的地址(网址/IP)的路径情况。用于优化网址/IP。
例如:tracert -d www.163.com
最大路径数:30
4.netstat 命令
它是一个监控TCP/IP网络的非常有用的工具,它可以显示路由表、实际的网络连接以及每一个网络接口设备的状态信息。Netstat用于显示与IP、TCP、UDP和ICMP协议相关的统计数据,一般用于检验本机各端口的网络连接情况。
Netstat命令相关的选项主要有以下几种。
netstat -s:能够按照各个协议分别显示其统计数据。如果应用程序(如IE浏览器)运行速度比较慢,或者不能显示Web页之类的数据,那么用户就可以 用本选项来查看所显示的信息。需要仔细查看统计数据的各行,找到出错关键字,进而确定问题所在。
netstat -e:用于显示关于以太网的统计数据。它列出的项目包括传送的数据包的总字节数、错误数、删除数、数据包的数量和广播的数量。这些统计数据既有发送的数据包数量,也有接收的数据包数量。这个选项可以用来统计一些基本的网络流量。
netstat -r:可以显示关于路由表的信息,类似于后面将要讲的使用route print命令时看到的信息。除了显示有效路由外,还显示当前有效的连接。
netstat -a:本选项显示一个所有的有效连接信息列表,包括已建立的连接(ESTABLISHED),也包括监听连接请求(LISTENING)的那些连接。
netstat -n:显示所有已经建立的有效连接。
最常用参数: -n -a
例如:netstat -an
这个主要是用户查看程序连接网络服务器的IP和端口。用于优化IP。
5.nslookup 命令
Nslookup命令可以用来监测网络中DNS服务器是否能正确实现域名解析。
ipconfig /flushdns 释放系统DNS缓存
nslookup –qt=类型 目标域名  反向解析查询(邮件系统需要)
(例子: nslookup -q=ptr 220.115.182.4)
nslookup –d [其他的参数] 目标域名 [指定的服务器地址]
维修过程可使用的DNS,判断网站问题
ShenZhenDns 211.162.78.1 深圳长宽
ZhongKeYuanDns 210.77.86.2 中科院
IDC 211.155.27.88 广州IDC
网通  210.22.70.3(210.22.70.227)
OpenDNS: 208.67.222.222-208.67.220.220 美国
Commands:       (identifiers are shown in uppercase, [] means optional)
NAME            - print info about the host/domain NAME using default server
NAME1 NAME2     - as above, but use NAME2 as server
help or ?       - print info on common commands; see nslookup(1) for details
set OPTION      - set an option
all         - print options, current server and host
[no]debug   - print debugging information
[no]d2      - print exhaustive debugging information
[no]defname - append domain name to each query
[no]recurse - ask for recursive answer to query
[no]vc      - always use a virtual circuit
domain=NAME - set default domain name to NAME
srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1,N2, etc.
root=NAME   - set root server to NAME
retry=X     - set number of retries to X
timeout=X   - set initial time-out interval to X seconds
querytype=X - set query type, e.g., A,ANY,CNAME,HINFO,MX,PX,NS,PTR,SOA,TXT,WKS,SRV,NAPTR
port=X      - set port number to send query on
type=X      - synonym for querytype
class=X     - set query class to one of IN (Internet), CHAOS, HESIOD or ANY
server NAME     - set default server to NAME, using current default server
lserver NAME    - set default server to NAME, using initial server
finger [USER]   - finger the optional USER at the current default host
root            - set current default server to the root
ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to FILE)
-a          -  list canonical names and aliases
-h          -  list HINFO (CPU type and operating system)
-s          -  list well-known services
-d          -  list all records
-t TYPE     -  list records of the given type (e.g., A,CNAME,MX, etc.)
例如:
adminxl@adminxl-desktop:~$ nslookup www.163.com
Server:        211.162.62.61
Address:    211.162.62.61#53
Non-authoritative answer:
www.163.com    canonical name = www.cache.gslb.netease.com.
Name:    www.cache.gslb.netease.com
Address: 61.135.253.17
Name:    www.cache.gslb.netease.com
Address: 61.135.253.18
Name:    www.cache.gslb.netease.com
Address: 61.135.253.10
Name:    www.cache.gslb.netease.com
Address: 61.135.253.11
Name:    www.cache.gslb.netease.com
Address: 61.135.253.12
Name:    www.cache.gslb.netease.com
Address: 61.135.253.13
Name:    www.cache.gslb.netease.com
Address: 61.135.253.14
Name:    www.cache.gslb.netease.com
Address: 61.135.253.15
Name:    www.cache.gslb.netease.com
Address: 61.135.253.16
这个命令主要用来优化网址,因为很多WEB服务器都不止一台服务器。