https://github.com/yucl80/code
https://github.com/yucl80/code
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yucl80/code
- Owner: yucl80
- Created: 2018-06-15T02:37:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-27T00:05:33.000Z (8 months ago)
- Last Synced: 2025-01-27T12:22:03.995Z (4 months ago)
- Language: Java
- Size: 13.3 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# code
FakeDNSFakeDNSTest
run with JVM options --add-opens java.base/java.net=ALL-UNNAMED
https://git1-us-west.apache.org/repos/asf?p=kudu.git;a=blob;f=java/kudu-client/src/test/java/org/apache/kudu/client/FakeDNS.java;hb=HEAD
https://bugs.openjdk.java.net/browse/JDK-8176361
Previous JDK releases documented how to configure `java.net.InetAddress` to use the JNDI DNS service provider as the name service. This mechanism, and the system properties to configure it, have been removed in JDK 9
A new mechanism to configure the use of a hosts file has been introduced.
A new system property `jdk.net.hosts.file` has been defined. When this system property is set, the name and address resolution calls of `InetAddress`, i.e `getByXXX`, retrieve the relevant mapping from the specified file. The structure of this file is equivalent to that of the `/etc/hosts` file.
When the system property `jdk.net.hosts.file` is set, and the specified file doesn't exist, the name or address lookup will result in an UnknownHostException. Thus, a non existent hosts file is handled as if the file is empty.https://blog.codefx.org/java/five-command-line-options-to-hack-the-java-9-module-system/