dnsjava: SocketTimeoutException on MacOS >= 12.5
Maven repo dnsjava 2.0.8 Lookup.run returns SocketTimeoutException on MacOS 12.5 Using some basic DNS test code:
import org.xbill.DNS.*;
import java.util.*;
...
Options.set("verbose", "true");
Lookup look = new Lookup("google.com");
String looked = Arrays.toString(look.run());
System.out.println(looked);
I get the result:
adding server <dns server IP>
lookup google.com. A
unknown
Sending to <dns server IP>:53
ExtendedResolver: got java.net.SocketTimeoutException
I can see in wireshark that there is a response from the DNS server, it seems it is not parsed by dnsjava:

About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 27 (11 by maintainers)
Commits related to this issue
- Extend logging in NIO clients to trace bugs Related to #194, #260 and #267 — committed to dnsjava/dnsjava by ibauersachs 2 years ago
- Extend logging in NIO clients to trace bugs Related to #194, #260 and #267 — committed to dnsjava/dnsjava by ibauersachs 2 years ago
I’ve now tried to debug this with my colleague @mkretz from @bespinian, on MacOS 14.6 with Java 11.0.21 (aarch). We were unable to reproduce the issue.
Sorry, but I’m lost here. Someone who still experiences this issue needs to debug this. Also, https://github.com/dnsjava/dnsjava/issues/260#issuecomment-1406937650 makes me wonder whether this really is a dnsjava issue or something in either the JVM or some other VPN or firewall tool/extension that blocks the Java process from getting the reply.