首页 Linux下常用网络信息查询操作
文章
取消

Linux下常用网络信息查询操作

ping

1
$ ping {host_domain | host_ip}

测试主机联通性

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ ping uphie.studio
PING uphie.studio (154.16.127.89) 56(84) bytes of data.
64 bytes from 154.16.127.89: icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from 154.16.127.89: icmp_seq=2 ttl=64 time=0.038 ms
64 bytes from 154.16.127.89: icmp_seq=3 ttl=64 time=0.036 ms
64 bytes from 154.16.127.89: icmp_seq=4 ttl=64 time=0.050 ms
64 bytes from 154.16.127.89: icmp_seq=5 ttl=64 time=0.038 ms
64 bytes from 154.16.127.89: icmp_seq=6 ttl=64 time=0.037 ms
64 bytes from 154.16.127.89: icmp_seq=7 ttl=64 time=0.038 ms
64 bytes from 154.16.127.89: icmp_seq=8 ttl=64 time=0.037 ms
64 bytes from 154.16.127.89: icmp_seq=9 ttl=64 time=0.038 ms
64 bytes from 154.16.127.89: icmp_seq=10 ttl=64 time=0.036 ms
^C
--- uphie.studio ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9000ms
rtt min/avg/max/mdev = 0.026/0.037/0.050/0.007 ms

whois

1
$ whois {host_domain}

查询域名信息

python.org 为例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
$ whois python.org
Domain Name: PYTHON.ORG
Registry Domain ID: D820868-LROR
Registrar WHOIS Server:
Registrar URL: http://www.gandi.net
Updated Date: 2017-02-25T03:10:25Z
Creation Date: 1995-03-27T05:00:00Z
Registry Expiry Date: 2018-03-28T05:00:00Z
Registrar Registration Expiration Date:
Registrar: Gandi SAS
Registrar IANA ID: 81
Registrar Abuse Contact Email:
Registrar Abuse Contact Phone:
Reseller:
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
Registry Registrant ID: C137341912-LROR
Registrant Name: Domain Administrator
Registrant Organization: Python Software Foundation
Registrant Street: 9450 SW Gemini Dr.
Registrant Street: ECM# 90772
Registrant City: Beaverton
Registrant State/Province: OR
Registrant Postal Code: 97008
Registrant Country: US
Registrant Phone: +49.2119304112
Registrant Phone Ext:
Registrant Fax: +1.8587128966
Registrant Fax Ext:
Registrant Email: e89d6901ba3e470e8cedc3eaa32a0074-1697561@contact.gandi.net
Registry Admin ID: C137341912-LROR
Admin Name: Domain Administrator
Admin Organization: Python Software Foundation
Admin Street: 9450 SW Gemini Dr.
Admin Street: ECM# 90772
Admin City: Beaverton
Admin State/Province: OR
Admin Postal Code: 97008
Admin Country: US
Admin Phone: +49.2119304112
Admin Phone Ext:
Admin Fax: +1.8587128966
Admin Fax Ext:
Admin Email: e89d6901ba3e470e8cedc3eaa32a0074-1697561@contact.gandi.net
Registry Tech ID: C137341913-LROR
Tech Name: Technical Administrator
Tech Organization: Python Software Foundation
Tech Street: 9450 SW Gemini Dr.
Tech Street: ECM# 90772
Tech City: Beaverton
Tech State/Province: OR
Tech Postal Code: 97008
Tech Country: US
Tech Phone: +49.2119304112
Tech Phone Ext:
Tech Fax: +1.8587128966
Tech Fax Ext:
Tech Email: 7fd79ebe18980da9baceef0fa1b27680-1705778@contact.gandi.net
Name Server: NS3.P11.DYNECT.NET
Name Server: NS1.P11.DYNECT.NET
Name Server: NS2.P11.DYNECT.NET
Name Server: NS4.P11.DYNECT.NET
DNSSEC: unsigned
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of WHOIS database: 2017-10-09T06:45:56Z <<<

For more information on Whois status codes, please visit https://icann.org/epp

Access to Public Interest Registry WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the Public Interest Registry registry database. The data in this record is provided by Public Interest Registry for informational purposes only, and Public Interest Registry does not guarantee its accuracy. This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: (a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or Afilias except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. Public Interest Registry reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy.

dig

查询域名的DNS信息

1
$ dig {domain}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ dig uphie.studio

; <<>> DiG 9.10.3-P4-Ubuntu <<>> uphie.studio
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25171
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;uphie.studio.			IN	A

;; ANSWER SECTION:
uphie.studio.		600	IN	A	154.16.127.89

;; Query time: 226 msec
;; SERVER: 181.41.222.18#53(181.41.222.18)
;; WHEN: Mon Oct 09 01:53:24 CDT 2017
;; MSG SIZE  rcvd: 57

该记录默认查询的是 A 记录。当然也可以查询其它类型的记录。

本文由作者按照 CC BY 4.0 进行授权