There are many ways to do this (lowercase and reverse the string, append a '.' if not there, append a '%', and do a LIKE). But I'm looking for one that will perform well when the master domain list is an indexed field in a table, and when the possible subdomain is either an individual value, or a field in a table for a join (potentially indexed).