I am using "InetAddress.getByName("hostname")" to resolve the host name of smart host before sending the mail through SMTP.
Getting exception while resolving Host : Host Name=smarthost.demo.com Exception=java.net.UnknownHostException: smarthost.demo.com: Name or service not known. This issue only pops up when I send smtp messages back to back, after initial few success messages I am getting "unknown host exception", but if I restart the server it works fine again for inital few messages.
My observation - It's working fine with Java 7 but on Java 8 facing this issue but couldn't find relevant proofs for the same. Is it really because of Java versions or any other possible solution or reason is there ?