Skip to content

Commit

Permalink
auto commit
Browse files Browse the repository at this point in the history
Signed-off-by: Song Song Li <[email protected]>
  • Loading branch information
songleo committed Nov 24, 2024
1 parent b8aae13 commit 16b79d8
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions _posts/2024-11-23-network-debug-cmds.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ traceroute to 192.168.0.1 (192.168.0.1), 64 hops max, 40 byte packets

### curl

测试api、下载文件、查看网页内容和调试网络问题。

- 获取网页

```
Expand All @@ -82,3 +84,43 @@ curl -O http://www.example.com/file.txt
```
curl -o /dev/null -s -w "%{http_code}\n" http://www.example.com
```

### host

简洁高效的dns查询工具,用于解析域名和ip地址,或检查特定类型的dns记录。

- 查询域名的a记录

```
$ host www.example.com
www.example.com has address 93.184.215.14
www.example.com has IPv6 address 2606:2800:21f:cb07:6820:80da:af6b:8b2c
```

- 显示域名的权威dns服务器

```
$ host -t ns example.com
example.com name server a.iana-servers.net.
example.com name server b.iana-servers.net.
```

- 反向解析ip地址

```
$ host 1.1.1.1
1.1.1.1.in-addr.arpa domain name pointer one.one.one.one.
```

- 指定dns服务器

```
$ host www.example.com 1.1.1.1
Using domain server:
Name: 1.1.1.1
Address: 1.1.1.1#53
Aliases:
www.example.com has address 93.184.215.14
www.example.com has IPv6 address 2606:2800:21f:cb07:6820:80da:af6b:8b2c
```

0 comments on commit 16b79d8

Please sign in to comment.