Yes; but I assume a bit resource intensive or difficult in some other way. Or maybe it's just no one cares to do it much, since the results can't be trusted 100% in any case.
Google for it and note that the entire first couple of pages are commercial services offering to do just what you're asking for...
I imagine it's some combination of reverse DNS lookups and whois on a grand scale (start with Class A, then B, etc.....)