Closed jonasbb closed 7 years ago
Thank you for opening this issue!
As you have noticed, this library currently has support for only TLDs and email addresses.
- Is this a use case this crate/their maintainers want to support?
Yes, absolutely.
- What would be the best way to implement support for this?
To be consistent with the rest of the library, we will probably need to add the following method to List:
pub fn parse_dns_name(&self, name: &str) -> Result<DnsName>
We should also be able to extract Domain
from DnsName
where possible by implementing:
pub fn domain(&self) -> Option<Domain>
I will try to find time to implement this by tomorrow if you don't beat me to it.
This crate currently seems to be the only project implementing the PSL algorithm for rust unfortunately, it requires the input to be a valid domain.
This requirement is too strict for my use case. I want to analyze DNS data, however DNS is much more generous what it allows in its labels. RFC 2181 specifies:
For my use cases supporting the printable ASCII subset is plenty as I am mostly interested in the effective second level domain. A concrete example of what does not work currently is
_tcp.example.com.
, which is often found for SRV resource records.