File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Java Dns Cache Manipulator(DCM)
1313包含子工程:
1414
1515- [ Java Dns Cache Manipulator Library] ( library )
16- 通过代码直接设置` Java ` 的` DNS ` (实际上设置的是` DNS Cache ` ),支持` JDK 6+ ` 。
16+ 通过代码直接设置` Java ` 的` DNS ` (实际上设置的是` DNS Cache ` ),支持` JDK 6+ ` ,支持 ` IPv6 ` 。
1717- [ Java Dns Cache Manipulator Tool] ( tool )
1818 用于修改/查看 运行中` JVM ` 进程的` DNS Cache ` 。
1919
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Java Dns Cache Manipulator(DCM) Library
1010[ ![ GitHub issues] ( https://img.shields.io/github/issues/alibaba/java-dns-cache-manipulator.svg )] ( https://github.com/alibaba/java-dns-cache-manipulator/issues )
1111[ ![ License] ( https://img.shields.io/badge/license-Apache%202-4EB1BA.svg )] ( https://www.apache.org/licenses/LICENSE-2.0.html )
1212
13- :point_right : 通过代码直接设置` Java ` 的` DNS ` (实际上设置的是` DNS Cache ` ),支持` JDK 6+ ` 。
13+ :point_right : 通过代码直接设置` Java ` 的` DNS ` (实际上设置的是` DNS Cache ` ),支持` JDK 6+ ` ,支持 ` IPv6 ` 。
1414
1515:wrench : 功能
1616=====================================
@@ -52,13 +52,16 @@ Java Dns Cache Manipulator(DCM) Library
5252----------------------------------
5353
5454``` java
55- DnsCacheManipulator . setDnsCache(" www.hello-world.com" , " 192.168.1.1" );
55+ DnsCacheManipulator . setDnsCache(" www.hello.com" , " 192.168.1.1" );
56+ DnsCacheManipulator . setDnsCache(" www.world.com" , " 1234:5678:0:0:0:0:0:200e" ); // 支持IPv6设备
5657
5758// 之后Java代码中使用到域名都会解析成上面指定的IP。
5859// 下面是一个简单获取域名对应的IP,演示一下:
5960
60- String ip = InetAddress . getByName(" www.hello-world .com" ). getHostAddress();
61+ String ip = InetAddress . getByName(" www.hello.com" ). getHostAddress();
6162// ip = "192.168.1.1"
63+ String ipv6 = InetAddress . getByName(" www.world.com" ). getHostAddress();
64+ // ipv6 = "1234:5678:0:0:0:0:0:200e"
6265```
6366
6467通过` dns-cache.properties ` 文件批量配置
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Java Dns Cache Manipulator Tool
99[ ![ GitHub issues] ( https://img.shields.io/github/issues/alibaba/java-dns-cache-manipulator.svg )] ( https://github.com/alibaba/java-dns-cache-manipulator/issues )
1010[ ![ License] ( https://img.shields.io/badge/license-Apache%202-4EB1BA.svg )] ( https://www.apache.org/licenses/LICENSE-2.0.html )
1111
12- :point_right : 修改/查看 运行中` JVM ` 进程的` DNS Cache ` 。
12+ :point_right : 修改/查看 运行中` JVM ` 进程的` DNS Cache ` ,支持 ` IPv6 ` 。
1313
1414:wrench : 功能
1515=================================
You can’t perform that action at this time.
0 commit comments