You can't. There's no general way to look up all hostnames that resolve to a given IP. (For example, if I decided to create a record on my DNS server right now that pointed foo.example.com
to 1.2.3.4
, there's no way that you could find that out unless you happened to look it up. No lookup on 1.2.3.4
would ever reveal it to you.)
There are a few tools available online that can give you a partial listing, but they're all based on picking up hostnames from domain name registries, web crawls, and the like and keeping track of what they all resolve to. No magic to it, just a lot of hard work to build a database.