Closed idoa01 closed 7 years ago
The PSL doesn't deal with IP addresses at all. https://publicsuffix.org/
The scope of the PSL is to handle domain name suffixes. I'm not sure what you are trying to achieve, but if it involves IP addresses, then this library won't definitely be able to help you.
It seems that PublicSuffix returns a bad result for IP addresses:
for me, the best result would be that
PublicSuffix.domain("1.2.3.4") == "1.2.3.4"
But a
DomainInvalid
or a newDomainIsIP
would also make more sense than the current behavior (and even more so since the leftmost byte is more important than the rightmost byte)and if we are already on the subject, the behavior of PublicSuffix on IPv6 is:
and for completeness, it might be best to throw the same error on IPv6 and IPv4 addresses.