Skip to content

Commit

Permalink
Compatibility with RFC 2181
Browse files Browse the repository at this point in the history
According to RFC2181, every DNS query needs to have a . at the end of
the name record you are requesting.

This will show that that name record is the root of the domain you are
asking
In some cases, when the . is missing, the hostname of the server the
code is running on will be appended to the name record when
checkdnsrr() is being executed and this will in turn return a false
positive when there is a wildcard DNS record for the root domain of the
hostname of the server.
  • Loading branch information
LeShadow committed Jan 25, 2017
1 parent c0c888a commit 08bac06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions EmailValidator/Validation/DNSCheckValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function getWarnings()

protected function checkDNS($host)
{
$host = rtrim($host, '.') . '.';

$Aresult = true;
$MXresult = checkdnsrr($host, 'MX');

Expand Down

0 comments on commit 08bac06

Please sign in to comment.