Hello, not sure how I feel about the res_init(). Depending on the backends used this might be expensive. Especially since it wont be rate limited. The negative-ttl of 10s is for single records I thing. So at a minimum you should rate-limit res_init to the same negative-ttl time).
But another aspect: this is also a problem for positive answers. Only because you get an answer does not mean it is the NS you wanted to query. Maybe a background refreshing could solve both? Would also reduce concurrency. debian/ubuntu BTW seems to have a rather elaborate reload hook mechanism: http://manpages.ubuntu.com/manpages/gutsy/man8/resolvconf.8.html But that is I guess hard to integrate with JVM. Gruss Bernd Am Mon, 04 May 2015 17:38:46 +0200 schrieb Stanislav Baiduzhyi <sbaid...@redhat.com>: > Hi All, > > We are facing an issue with DNS server caching on RHEL-based distros: > after the update of resolv.conf java application cannot resolve the > hosts any more. > > Reproducer is very simple: > 1. Clean /etc/resolv.conf or connect to vpn and use vpn-only > nameserver. 2. Launch the minimal java app [1]. > 3. Restore the /etc/resolv.conf or disconnect from vpn > (/etc/resolv.conf should be updated with accessible nameserver at > this moment). 4. Notice that name resolution continues to fail. > > I've prepared a small webrev that fixes the issue [2], but would like > to hear some ideas/criticism first. If the patch looks ok to > everyone, please create an issue for this, and I will submit it for > approval/sponsorship. > > [1]: > https://e61b615da46327c9050d624b0a3783ba21c6b125.googledrive.com/host/0B5Kp-cB1sXJrfnZ4NHZ0S1V3UTJZcDFra3RwUFZjQXY5WVZzUkwtTTd0Z1IyR1JmbDZPSVk/resolvconf-reinit/ResolvingHost.java > > [2]: > https://e61b615da46327c9050d624b0a3783ba21c6b125.googledrive.com/host/0B5Kp-cB1sXJrfnZ4NHZ0S1V3UTJZcDFra3RwUFZjQXY5WVZzUkwtTTd0Z1IyR1JmbDZPSVk/resolvconf-reinit/ >