forked from leftypol/leftypol
add forward-confirmed reverse DNS
This commit is contained in:
parent
6804a2ede0
commit
8b9932218f
2 changed files with 9 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue