Skip to content

On production specific domains can not be resolved #408

Open
@alexander-schranz

Description

@alexander-schranz

I have a IONOS and google cloud server and some A records fail to resolve the DNS_A + DNS_MX part:

php -r 'require_once("vendor/autoload.php"); $dnsCheckValidation = new \Egulias\EmailValidator\Validation\DNSCheckValidation(); var_dump($dnsCheckValidation->isValid("[email protected]", new \Egulias\EmailValidator\EmailLexer())); var_dump($dnsCheckValidation->getError());'

Locally all works like expected.

If I change todo only a MX Lookup and not a A lookup all works like expected:

-        $dnsRecordsResult = $this->dnsGetRecord->getRecords($host, DNS_A + DNS_MX);
+        $dnsRecordsResult = $this->dnsGetRecord->getRecords($host, DNS_MX);

So maybe change to something like:

        $dnsRecordsResult = $this->dnsGetRecord->getRecords($host, DNS_MX);

        $dnsRecords = [];
        if (! $dnsRecordsResult->withError()) {
            $dnsRecords = $dnsRecordsResult->getRecords();
        }

        $dnsRecordsResult = $this->dnsGetRecord->getRecords($host, DNS_A);

        if (! $dnsRecordsResult->withError()) {
            $dnsRecords = array_merge($dnsRecords, $dnsRecordsResult->getRecords());
        }

        // Combined check for A+MX+AAAA can fail with SERVFAIL, even in the presence of valid A/MX records
        $aaaaRecordsResult = $this->dnsGetRecord->getRecords($host, DNS_AAAA);

        if (! $aaaaRecordsResult->withError()) {
            $dnsRecords = array_merge($dnsRecords, $aaaaRecordsResult->getRecords());
        }

Think this is similar to @crishoj #376

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions