Re: Why does checkdnsrr() default to MX??
| From: | Adam Harvey | Date: | Fri, 19 Sep 2014 17:54:30 +0000 |
| Subject: | Re: Why does checkdnsrr() default to MX?? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77348@lists.php.net to get a copy of this message | ||
On 19 September 2014 10:51, Kris Craig <kris.craig@gmail.com> wrote:
> On Fri, Sep 19, 2014 at 10:24 AM, Adam Harvey <aharvey@php.net> wrote:
>> As an alternative, could we just make the type argument mandatory in
>> PHP 7 and start issuing E_DEPRECATED warnings if it's omitted in 5.6
>> or 5.7?
>
> I like both ideas. Adam's approach would be more inconvenient for
> developers, but it would also be less of a BC issue since merely changing
> the default could cause some existing code to fail silently as opposed to
> generating an error. On the other hand, I can't think of any such use case
> in which checking all DNS entries instead of just MX would cause any scripts
> to break. The only possible scenario I can think of would be if they're
> using dnsrr() to check if an MX record exists and hit a host that has an A
> record but not MX. That would cause it to return TRUE when they're
> expecting FALSE.
I'm not a huge fan of silently making it ANY for the reason Sanford
explained elsethread — it's a potential vector for amplification
attacks. I also don't think it's unreasonable to expect developers to
know what type of record they're interested in. :)
> I'll draft an RFC when I get a chance and include both options in it.
Thanks!
Adam