diff options
| author | Bui <bui@bui.pm> | 2014-10-06 03:37:13 +0900 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-10-05 23:20:06 +0200 |
| commit | 8b9932218ffa0e53b05cad5bc769f9317687e6da (patch) | |
| tree | ce68832e9ae98c328f17778f7b13e898a0a84df9 /inc/functions.php | |
| parent | 6804a2ede07438ba1bac922a9a6a914c30651127 (diff) | |
add forward-confirmed reverse DNS
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php index 357666d6..8c5f46b9 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2265,6 +2265,7 @@ function rDNS($ip_addr) { if (!$config['dns_system']) { $host = gethostbyaddr($ip_addr); + $isip = filter_var($host, FILTER_VALIDATE_IP); } else { $resp = shell_exec_error('host -W 1 ' . $ip_addr); if (preg_match('/domain name pointer ([^\s]+)$/', $resp, $m)) @@ -2273,6 +2274,10 @@ function rDNS($ip_addr) { $host = $ip_addr; } + if ($config['fcrdns'] && !$isip && gethostbyname($host) != $ip_addr) { + $host = $ip_addr; + } + if ($config['cache']['enabled']) cache::set('rdns_' . $ip_addr, $host); |
