remotelyliving / php-dns

A DNS abstraction for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to query PTR, PTRData is missing in DataAbstract factory

lynnverse opened this issue · comments

I am trying to query for a PTR. Generally, this works for both GoogleDNS and Localsystem Resolvers (we get the correct result from the Resolver), except, when mapping the result, DataAbstract::createFromTypeAndString does not support PTR data. An if-clause for the PTR type is missing, so an exception is thrown.

To Reproduce
Get a new Resolver\GoogleDNS(), create a query for a reverted IP with .in-addr.arpa attached, and with type PTR. An exception is thrown ("RemotelyLiving\PHPDNS\Exceptions\InvalidArgumentException : fra16s42-in-f3.1e100.net could not be created with type PTR")

Expected behavior
A DNSRecord containing a PTRData extends DataAbstract object with the PTR query result should be returned. The PTRData object should probably be identical or very similar to the CNAMEData object.

I can make a Pull Request, but maybe there is a reason this isn't implemented?

Hmm, honestly probably an oversight. Feel free to PR and we can go from there.

@lynnverse thanks for being willing to tackle this. I'll be around all weekend for review and next week is pretty slow.

Thank you so much for your contribution @lynnverse! I released it under 4.3.0