When fetching domain records, quit if no SOA record exists (prevents most sub-domains)

This commit is contained in:
wrongecho 2025-11-06 11:57:08 +00:00
parent 3813fbf8f2
commit 09f3bfd8f4
1 changed files with 2 additions and 2 deletions

View File

@ -520,7 +520,7 @@ function getDomainRecords($name)
$records = array();
// Only run if we think the domain is valid
if (!filter_var($name, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
if (!filter_var($name, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) || !checkdnsrr($name, 'SOA')) {
$records['a'] = '';
$records['ns'] = '';
$records['mx'] = '';
@ -1292,7 +1292,7 @@ function fetchUpdates() {
function getDomainExpirationDate($domain) {
// Execute the whois command
$result = shell_exec("whois " . escapeshellarg($domain));
if (!$result) {
if (!$result || !checkdnsrr($domain, 'SOA')) {
return null; // Return null if WHOIS query fails
}