linux 域名对应ip 端口号,【原创】Linux基础之测试域名IP端口连通性

一 测试域名是否可达

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=/

<

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值