Search code examples
phpipcertificatedomain-name

Certificates check a what domain(s) is/are there in an IP address. How to do it with PHP?


How do certificates check an IP address against domain name(s)? What is the protocol and parameters etc? How to check how much domains are there in an IP address with PHP?


Solution

  • There's no PHP tool that would do this. But there are services that maintain full(ish) reverse mapping databases, such as http://ipneighbor.com/

    With PHP, at most you could look up the standard IP->Domain PTR record, but there's ever only one of those for any given IP - you wouldn't get all the domains using the IP. For that, people crawl the full DNS database (which is HUGE and fully distributed) and build their own reverse lookup maps.