code: public static void setDnsCachePolicy(int cacheSeconds) {
          try {
              InetAddressCacheUtil.setDnsCachePolicy(cacheSeconds);
          } catch (Exception e) {
              throw new DnsCacheManipulatorException("Fail to setDnsCachePolicy, cause: " + e.toString(), e);
          }
      }
docs: Set JVM DNS cache policy
  <p>
  NOTE: if Security Manage is turn on, JVM DNS cache policy set will not take effective. You can check by method {@link #getDnsCachePolicy()}.
  
  @param cacheSeconds set default dns cache time. Special input case:
  <ul>
  <li> {@code -1} means never expired.(In effect, all negative value)</li>
  <li> {@code 0} never cached.</li>
  </ul>
  @throws DnsCacheManipulatorException Operation fail
  @since 1.3.0