private static boolean _hasMXRecord ( @ Nonnull final String sHostName ) { try { final Record [ ] aRecords = new Lookup ( sHostName , Type . MX ) . run ( ) ; return aRecords != null && aRecords . length > 0 ; } catch ( final Exception ex ) { // Do not log this message, as this method is potentially called very // often! if ( LOGGER . isWarnEnabled ( ) ) LOGGER . warn ( "Failed to check for MX record on host '" + sHostName + "': " + ex . getClass ( ) . getName ( ) + " - " + ex . getMessage ( ) ) ; return false ; } }
Check if the passed host name has an MX record .