On vista, -Dsun.net.spi.nameservice.provider.1 -Dsun.net.spi.nameservice.nameservers bypassed in kerneljre
Test run with:
java version "1.6.0_10-ea"
Java(TM) SE Runtime Environment (build 1.6.0_10-ea-b08)
Java HotSpot(TM) Kernel VM (build 11.0-b06-internal-20070910, mixed mode)
Steps to reproduce:
1. Install the kernel jre "*windows-i586-p-iftw-k.exe"
2. Make sure run the test from kerneljre's "initial form"
(either immediately(before Kernel has time to finish background downloading)run test after install, or perform step 3 4)
(optinal)3. Kill the background download ( by killing the "java" process )
(optinal)4. Remove all files under ${ProgramFiles}/Java/jre6/lib/bundles/
5. Run Test (Test.java list below) options ( example run.sh attached ) :
-Dsun.net.spi.nameservice.provider.1=dns,sun \ -Dsun.net.spi.nameservice.nameservers=<nameserver_ip>
Exception thrown at line :InetAddress addr1 = InetAddress.getByName("webcache.sfbay");
java.net.UnknownHostException: webcache.sfbay
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1200)
at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
at java.net.InetAddress.getAllByName(InetAddress.java:1083)
at java.net.InetAddress.getAllByName(InetAddress.java:1019)
at java.net.InetAddress.getByName(InetAddress.java:969)
at Test.main(Test.java:8)
------- Test.java Begin -------
import java.net.*;
public class Test
{
public static void main(String[] args)
{
try {
InetAddress addr1 = InetAddress.getByName("webcache.sfbay");
System.out.println("webcache.sfbay=" + addr1);
} catch(Exception e) {
e.printStackTrace();
}
try {
InetAddress addr2 = InetAddress.getByName("webcache.sfbay.sun.com");
System.out.println("webcache.sfbay.sun.com=" + addr2);
} catch(Exception e) {
e.printStackTrace();
}
}
}
------- Test.java End -------
No problem if run with normal jdk/jre on the same machine
No problem on winxp for both normal jdk and kerneljre