Extract domain name from a host name
Your algorithm is the right one. Since zone cuts are not reflected in the domain name (you see domain cuts - the dots - but not zone cuts), it is the only correct one.
An approximate algorithm is to use a list of zones, like the one mentioned by Alnitak. Remember that these static lists are not authoritative, they lack many registries, they are stale, etc.
Is there a programatic way to find the domain name from a given hostname?
given -> www.yahoo.co.jp 
return -> yahoo.co.jp
The approach that works but is very slow is:
split on "." and remove 1 group from the left, join and query an SOA record using dnspython
when a valid SOA record is returned, consider that a domain
Is there a cleaner/faster way to do this without using regexps?