Skip to content

Commit dd089fc

Browse files
committed
update readme alibaba#30
1 parent 22f6309 commit dd089fc

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

tool/README.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ usage: Options
4141
---------------
4242

4343
```bash
44-
# 对进程ID是12345的Java进程,设置域名 baidu.com IP为 1.1.1.1
45-
$ dcm -p 12345 set baidu.com 1.1.1.1
46-
set DONE.
44+
# 对进程ID是12345的Java进程,设置域名 foo.com IP为 1.1.1.1
45+
$ dcm -p 12345 set foo.com 1.1.1.1
46+
# 对进程ID是12345的Java进程,设置域名 bar.com IP为 2.2.2.2 3.3.3.3(可以多个IP)
47+
$ dcm -p 12345 set bar.com 2.2.2.2 3.3.3.3
4748
```
4849

4950
查看`DNS Cache`内容
@@ -54,16 +55,21 @@ set DONE.
5455
```bash
5556
# 对进程ID是12345的Java进程,获取域名 baidu.com 的DNS条目信息
5657
$ dcm -p 12345 get baidu.com
57-
DnsCacheEntry{host='baidu.com', ips=[1.1.1.1], expiration=292278994-08-17 15:12:55.807+0800}
58-
get DONE.
58+
baidu.com 220.181.57.217,180.149.132.47,123.125.114.144 2015-06-05T18:56:09.635+0800
59+
# 输出格式是 域名 IP列表(可能有多个IP) ​失效时间
5960
```
6061

6162
查看全部
6263

6364
```bash
6465
$ dcm -p 12345 list
65-
DnsCache{cache=[DnsCacheEntry{host='bar.com', ips=[1.1.1.1], expiration=292278994-08-17 15:12:55.807+0800}, DnsCacheEntry{host='foo.com', ips=[1.1.1.1], expiration=292278994-08-17 15:12:55.807+0800}, DnsCacheEntry{host='baidu.com', ips=[180.149.132.47, 123.125.114.144, 220.181.57.217], expiration=2015-06-03 17:49:42.077+0800}], negativeCache=[]}
66-
list DONE.
66+
Dns cache:
67+
bar.com 2.2.2.2,3.3.3.3 292278994-08-17T15:12:55.807+0800
68+
baidu.com 220.181.57.217,180.149.132.47,123.125.114.144 2015-06-05T19:00:30.514+0800
69+
foo.com 1.1.1.1 292278994-08-17T15:12:55.807+0800
70+
Dns negative cache:
71+
# 输出包含Cache 和 Negative Cache的条目。条目缩进了4个空格。
72+
# 上面的示例中,Negative Cache为空。
6773
```
6874

6975
删除/清空`DNS Cache`
@@ -72,11 +78,8 @@ list DONE.
7278
```bash
7379
# 删除一条DNS
7480
$ dcm -p 12345 rm baidu.com
75-
rm DONE.
76-
77-
# 清除DNS
81+
# 清除所有DNS Cache
7882
$ dcm -p 12345 clear
79-
clear DONE.
8083
```
8184

8285
修改/查看`JVM`缺省的`DNS`的缓存时间
@@ -86,20 +89,13 @@ clear DONE.
8689
# 查看缓存时间,单位秒。-1表示永远缓存,0表示不缓存
8790
$ dcm -p 12345 getPolicy
8891
30
89-
getPolicy DONE.
90-
9192
# 设置缓存时间
9293
$ dcm --pid 12345 setPolicy 5
93-
setPolicy DONE.
94-
9594
# 查看未命中条目的缓存时间,单位秒。-1表示永远缓存,0表示不缓存
9695
$ dcm -p 12345 getNegativePolicy
9796
10
98-
getNegativePolicy DONE.
99-
10097
# 修改未命中条目的缓存时间
10198
$ dcm -p 12345 setNegativePolicy 0
102-
setNegativePolicy DONE.
10399
```
104100

105101
:books: 相关资料

0 commit comments

Comments
 (0)