FULL PRODUCT VERSION :
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Network configuration will be described in "Steps to Reproduce".
A DESCRIPTION OF THE PROBLEM :
When Windows is configured to append parent suffixes of the primary DNS suffix, Java does not look for the parent suffixes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
First we have to configure the network.
1. Start Menu -> Settings -> Network Connections -> Local Area Connection
2. Properties -> Internet Protocol (TCP/IP) -> Properties
3. Set an IP address manually (a customer of ours has this happen with DHCP, but I could only make it happen with manual entries.)
4. Click Advanced
5. On the DNS tab, select "Append primary and connection specific DNS suffixes", and also check "Append parent suffixes of the primary DNS suffix". Leave "DNS suffix for this connection" blank.
6. OK -> OK, and then close all dialogs.
7. Start Menu -> Settings -> Control Panel -> System
8. On the Computer Name tab, click "Change...", check that there is a computer name.
9. Click "More..." and enter a primary DNS suffix.
10. OK -> OK, and then close the final dialog.
11. Reboot the computer (Windows will tell you to.)
Now, we confirm the network settings.
12. Open a command prompt, and run ipconfig /all. The relevant selection at the top will look like this:
Host Name . . . . . . . . . . . . : xylophone
Primary Dns Suffix . . . . . . . : my.domain.name.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : Yes
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : my.domain.name.com
domain.name.com
name.com
And finally, showing the bug:
13. Compile and run the provided code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Output should look like the following:
[my.domain.name.com, domain.name.com, name.com]
ACTUAL -
Actual output is:
[]
As a result, no DNS lookups will work if the target hostname is on one of the parent domains (it looks like the code in Java also falls back to trying the domain name found from InetAddress.getLocalHost(), as well as checking all suffixes.)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No errors occur, it silently returns no results.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import sun.net.dns.ResolverConfiguration;
public class Test {
public static void main(String[] args) {
System.out.println(ResolverConfiguration.open().searchlist());
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
No known workaround to find the other suffixes, possible workaround for finding the primary domain name, but that's only 1/3 of what we need.
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Network configuration will be described in "Steps to Reproduce".
A DESCRIPTION OF THE PROBLEM :
When Windows is configured to append parent suffixes of the primary DNS suffix, Java does not look for the parent suffixes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
First we have to configure the network.
1. Start Menu -> Settings -> Network Connections -> Local Area Connection
2. Properties -> Internet Protocol (TCP/IP) -> Properties
3. Set an IP address manually (a customer of ours has this happen with DHCP, but I could only make it happen with manual entries.)
4. Click Advanced
5. On the DNS tab, select "Append primary and connection specific DNS suffixes", and also check "Append parent suffixes of the primary DNS suffix". Leave "DNS suffix for this connection" blank.
6. OK -> OK, and then close all dialogs.
7. Start Menu -> Settings -> Control Panel -> System
8. On the Computer Name tab, click "Change...", check that there is a computer name.
9. Click "More..." and enter a primary DNS suffix.
10. OK -> OK, and then close the final dialog.
11. Reboot the computer (Windows will tell you to.)
Now, we confirm the network settings.
12. Open a command prompt, and run ipconfig /all. The relevant selection at the top will look like this:
Host Name . . . . . . . . . . . . : xylophone
Primary Dns Suffix . . . . . . . : my.domain.name.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : Yes
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : my.domain.name.com
domain.name.com
name.com
And finally, showing the bug:
13. Compile and run the provided code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Output should look like the following:
[my.domain.name.com, domain.name.com, name.com]
ACTUAL -
Actual output is:
[]
As a result, no DNS lookups will work if the target hostname is on one of the parent domains (it looks like the code in Java also falls back to trying the domain name found from InetAddress.getLocalHost(), as well as checking all suffixes.)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No errors occur, it silently returns no results.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import sun.net.dns.ResolverConfiguration;
public class Test {
public static void main(String[] args) {
System.out.println(ResolverConfiguration.open().searchlist());
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
No known workaround to find the other suffixes, possible workaround for finding the primary domain name, but that's only 1/3 of what we need.