0

The situation is rather simple: to reproduce failures which had happened in a recent outage, I'd like to deliberately fail DNS resolution in JVM's in:

Caused by: java.net.UnknownHostException: ...domain.name...
at java.net.InetAddress.getAllByName0(InetAddress.java:1280)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at java.net.InetAddress.getByName(InetAddress.java:1076)

would it make sense to do it directly via linux DNS settings or on a JVM level. How could it be done?

1 Answers1

2

SloDNS is a forwarding server specifically built for testing failure DNS modes: https://github.com/brennentsmith/slodns

You can add any quantity of delay, jitter, and loss to queries all sent to it and will transparently forward requests to any upstream server. It doesn't mangle the UDP datagram so it works with proprietary DNS protocol extensions.

For your case, you could run it and set the --loss argument to a high value, or set the --delay and --jitter to a value greater than the JVM's timeout.

Fair disclosure as well, I wrote it :)

Brennen Smith
  • 1,742
  • 8
  • 11