I'm using the following code to verify that an email address has a valid DNS (otherwise, we consider the email invalid).
$domain = substr($email, strrpos($email, '@') + 1); $isValid = checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A');
However, today it just flagged nearly all @gmail.com and @yahoo.com emails as invalid. Obviously the domains gmail.com and yahoo.com are valid.
Why are there so many false positives for invalid email? What can I be doing instead that would be more accurate?