network diagnosis commands 网络诊断命令

  1. wget
    -- wget -S --spider -T 1 -t 2 sellerprof.vip
    -- wget -S --spider -T 1 -t 2  --no-check-certificate https://esams.vip
  2. curl
    -- curl -I --retry 2 --connect-timeout 1 sellerprof.vip
    -- curl -I --retry 2 --connect-timeout 1 -k https://esams.vip
  3. telnet
  4. nslookup
    -- nslookup -query=hinfo  -timeout=1 -retry=1 esams.vip
  5. ping
    -- ping -c 10 -W 1 sellerprof.vip
  6. traceroute/tracert
    -- traceroute esams.vip
  7. mtr
    -- mtr -w --timeout=1 esams.vip
  8. dig 由 BIND(互联网上最广泛使用的 DNS 软件) 提供的查询 DNS 的辅助工具,替换原来老的 nslookup 和 host

    dig //不带任何参数查询root dns .
    dig -h //help
    dig +short www.tianxiaohui.com // 简化输出
    dig +trace www.tianxiaohui.com //输出迭代式所有来回
    dig @8.8.8.8 tianxiaohui.com
    dig -x 54.222.60.252 //反向查询
    dig -f query.txt +short //从文件读
    dig google.com ANY //查询所有记录

  9. netstat
    来自于 net-tools 软件包. 已不推荐使用, 由 ss 命令来替换此命令.
    -- netstat -t --wide
    -- netstat -t -l
    -- netstat -s
  10. nstat
    来自于 iproute2 软件包
    -- nstat -a
    -- nstat #可以提供2 次使用间的 delta
    -- nstat --json #以 json 格式输出
  11. ss
    来自 iproute2 软件包, 用以替换 netstat. 更偏重于 socket 连接, 数据来自 /proc/net/tcp.
    -- ss -t -l
    -- ss --info
    -- ss -it state syn-sent #根据状态查
    -- ss -it dst abc.tianxiaohui.com #根据地址过滤
    -- ss -it '( dport = :443 )' #根据目标端口查, 一定要注意这里面的空格, 括号里的空格每处都需要
    -- ss -it '( dport = :443 or dport = :80 )' #或者
    -- ss -it '( sport = :45321 )' #根据源端口查,
  12. routetable
    -- netstat -r
  13. ifconfig/ipconfig

标签: none

添加新评论