应几位朋友所邀,今天我们来了解下路由查询命令tracert的使用。
Tracert命令用于跟踪一个消息从一台电脑到另一台电脑所走过的路径,或者是一个设备到另一个设备所走的路径。在网络出现故障时,合理地使用Tracert命令,能够帮助我们快速定位问题出现在哪个环节。一目了然,下面,就来向大家介绍Tracert命令的用法。
一、tracert的用法
在使用Tracert命令之前,我们先来简单地介绍一下它的语法。其中最简单也是最常用的命令格式为:
1、基本用法

Tracert 目标设备的ip地址或者网址:
例1、检测ip地址经过几个跃点

这里面是经过了两个跃点。
例2:检测网址经过几个跃点

例3、“tracert -d baidu.com”代表不将IP地址解析到主机名称,如下图所示:

例4、“tracert -h 3 baidu.com”代表本次tracert搜索的最大跳数,输入3表示搜索在路由器跳转3次,如下图所示:

这个就是查跟设备最近的几个连接点的问题,通常在网络问题中,先要排除前端跟设备直接连接的最近的几个设备是否有故障,如果这几个近点跟踪可以正常互通,那么问题可能就出现在后端。
例5、“tracert -w 6 baidu.com”代表tracert为每次回复所指定的毫秒数,其它命令根据需求,可以根据第二步图介绍使用,如下图所示:

当网络很慢,或者很卡时,我们要检测是那个设备的反应速度比较慢,所以这里面可以设个标准值,例如上面是直接显示回复6ms以内的设备,超过6ms的设备不显示,就是反应比较慢的,这个数值可以根据情况设置。
二、tracert用法案例
tracert 的作用:从你的电脑到你的网站,中间经过了多少个网络节点。换句话说,从A这里到B家需要走多少条街,进而可以知道到底是哪条路出了问题。
例子:

上图是在网络畅通无误,DNS解析正确的情况下 tracert ifunkey.com 的结果。