Set longer TTL for Java DNS caching policy.

Successful DNS lookups will cache for 5 minutes.
Unsuccessful lookups will cache for 1 hour.