* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
class HostnameResolver {
// Resolve hostname -> IP address
function resolveHostname ($hostname) {
- // If sql_patches is not at least 0.7.0, abort here and return the hostname (gethostbyname() may return something unwanted)
+ // If ext-sql_patches is not at least 0.7.0, abort here and return the hostname (gethostbyname() may return something unwanted)
if (!isExtensionInstalledAndNewer('sql_patches', '0.7.0')) {
// Abort here
return $hostname;
} else {
// Get IP address
$ip = gethostbyname($hostname);
+ //* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'ip=' . $ip . ',hostname=' . $hostname . ' - RESOLVED!');
// Count lookup hit
incrementStatsEntry('dns_lookup_hits');
// Set return value to $ip
//* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, sprintf("IP detected, cache entry written: %s->%s", $hostname, $ip));
+ $ret = $ip;
} else {
// Network address or broadcast address found
//* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, sprintf("IP %s is possibly a network or broadcast address.", $ip));
// Free result
SQL_FREERESULT($result);
- // Return IP number (let's hope it!
+ // Return IP number (let's hope it)
return $ret;
}