博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【原创】Linux基础之测试域名IP端口连通性
阅读量:4582 次
发布时间:2019-06-09

本文共 2593 字,大约阅读时间需要 8 分钟。

一 测试域名是否可达

1 ping

# ping www.baidu.com

PING www.a.shifen.com (220.181.112.244) 56(84) bytes of data.
64 bytes from 220.181.112.244 (220.181.112.244): icmp_seq=1 ttl=52 time=2.51 ms
64 bytes from 220.181.112.244 (220.181.112.244): icmp_seq=2 ttl=52 time=2.50 ms

2 nslookup

# nslookup www.baidu.com

Server: 103.224.222.222
Address: 103.224.222.222#53

Non-authoritative answer:

www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 220.181.112.244

二 测试ip是否可达

1 ping

# ping 220.181.112.244

PING 220.181.112.244 (220.181.112.244) 56(84) bytes of data.
64 bytes from 220.181.112.244: icmp_seq=1 ttl=52 time=2.57 ms
64 bytes from 220.181.112.244: icmp_seq=2 ttl=52 time=2.55 ms

2 traceroute

# traceroute 220.181.112.244

traceroute to 220.181.112.244 (220.181.112.244), 30 hops max, 60 byte packets
1 * * *
2 * * *
3 100.127.3.117 (100.127.3.117) 0.933 ms * 100.127.3.115 (100.127.3.115) 1.055 ms
4 * * *
5 100.127.125.82 (100.127.125.82) 2.489 ms 100.127.125.80 (100.127.125.80) 2.475 ms 100.127.125.18 (100.127.125.18) 2.519 ms
6 180.149.137.117 (180.149.137.117) 7.877 ms 180.149.137.145 (180.149.137.145) 3.965 ms 100.127.125.10 (100.127.125.10) 2.341 ms
7 180.149.159.77 (180.149.159.77) 2.347 ms 180.149.159.57 (180.149.159.57) 2.456 ms 180.149.159.17 (180.149.159.17) 3.372 ms
8 * 36.110.246.201 (36.110.246.201) 7.804 ms 180.149.159.17 (180.149.159.17) 2.341 ms
9 * 220.181.0.109 (220.181.0.109) 2.997 ms 36.110.246.205 (36.110.246.205) 2.756 ms
10 * 220.181.17.94 (220.181.17.94) 2.962 ms 220.181.17.22 (220.181.17.22) 2.767 ms
11 * * 220.181.17.150 (220.181.17.150) 2.559 ms
12 * * *
13 * * *
14 * * *

三 测试端口是否可达

1 telnet

# telnet 220.181.112.244 80

Trying 220.181.112.244...
Connected to 220.181.112.244.
Escape character is '^]'.

2 nc

# nc 220.181.112.244 80 -v

Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 220.181.112.244:80.

3 curl

# curl http://220.181.112.244:80 -v

* Trying 220.181.112.244...
* TCP_NODELAY set
* Connected to 220.181.112.244 (220.181.112.244) port 80 (#0)
> GET / HTTP/1.1
> Host: 220.181.112.244
> User-Agent: curl/7.63.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
< Connection: Keep-Alive
< Content-Length: 2381
< Content-Type: text/html
< Date: Sat, 16 Feb 2019 02:35:56 GMT
< Etag: "588604c8-94d"
< Last-Modified: Mon, 23 Jan 2017 13:27:36 GMT
< Pragma: no-cache
< Server: bfe/1.0.8.18
< Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/
<
<!DOCTYPE html>

 

转载于:https://www.cnblogs.com/barneywill/p/10386968.html

你可能感兴趣的文章
realsense blog 国外某人
查看>>
点击按钮将内容赋值到粘贴板
查看>>
DevExpress12.2.6 安装顺序记录
查看>>
.Net基础篇_学习笔记_第四天_switch-case02
查看>>
linux之基本命令讲解
查看>>
DAG上dp思想
查看>>
写文件
查看>>
iOS获取APP的版本号和名称
查看>>
如何用keytool导入证书
查看>>
第一周周六DailyReporting——PM(李忠)
查看>>
CF235C Cyclical Quest
查看>>
如何通过预加载器提升网页加载速度
查看>>
Android study
查看>>
hive源码之新建一个coroutine
查看>>
推荐用户体验设计师必读的5本用户体验书籍
查看>>
虚函数重写
查看>>
白盒测试中的几种逻辑覆盖
查看>>
Cortex-M3开发经验(二):确定发生HardFault的地方
查看>>
testng入门教程11 TestNG运行JUnit测试
查看>>
FloatHelper
查看>>