Doesn't the SpamAssassin URIBL stuff solve a similar problem ? That is:
foo.example.com -> example.com
foo.example.ac.uk -> example.ac.uk
Check out "RegistrarBoundaries.pm" in SpamAssassin - it has the relevant
lookup table. Not perfect but might help. As for the case of:
foo.example.ac.uk # bunch of spammers
bar.example.ac.uk # well behaved non-spammers
then this would be considered as "example.ac.uk", and we'd expect the
abuse team for example.ac.uk to deal with any problems, regardless of
whether there's devolved management, delegated DNS zones or whatever.