Why dns_get_record not working for some domains?

2k Views Asked by At

I use dns_get_record and getmxrr to get domain data mx and ns

But for some domains I can't get data, for example domain tecmilenio.mx dns_get_record('tecmilenio.mx', DNS_NS) return false with warning dns_get_record(): A temporary server error occurred.

I checked console command nslookup -type=mx tecmilenio.mx and it nothing find, and show error

Server: 127.0.1.1

Address: 127.0.1.1#53

** server can't find tecmilenio.mx: SERVFAIL

Why it appears for some domains and how to solve it?

1

There are 1 best solutions below

1
On

It isn't compulsory for a domain to have an MX record. In the absence of an MX record, email senders will attempt delivery to the address record - e.g. example.com.

This is based on RFC 5321 sec. 5, which states :

SMTP clients must look up an MX record; If (and only if) no MX record for the domain is present, treat the domain as if it had an MX record with the given domain as the target hostname and a preference value of 0 Perform A or AAAA lookups as required to determine the IP address of the target hostname

https://en.wikipedia.org/wiki/MX_record