I am wondering whether there is a realistic chance of a false negative when utilising checkdnsrr to check the domain part of a provided email address? I want to check this coming from a registration form to reduce the amount of mistypes on the client side.
$hostCheck = checkdnsrr("test.org", "MX");
Is checkdnsrr just "pretty reliable" or is there no practical chance of missing an actually existing domain? Because then I would omit such a check. I would appreciate an explanation on the WHYs of the reliability of the whole process. I have researched DNS (some), but I am not certain whether things like servers being temporarily offline or something else might have a measurable impact here.
No, this isn't reliable. dns isn't reliable in general. It's best-effort. It can also take a long time when an invalid domain is provided, so you need to consider a potential DOS of your system if someone hammers your script with a lot of invalid/offline domains.
In (little known) fact, domains don't even need to have an MX record for mail to be delivered. Mail delivery is supposed to fall back to using the A record for the host specified. That may not really happen much these days, but in theory..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With