From: Charles Calvert Date: 2010-08-20T13:00:24+09:00 Subject: Extract domain name All, I have the same basic issue as discussed in this thread last year: . Justin Collins points out the greatest difficulty with the situation, i.e. that when dealing with a country code TLD, one may well have a different number of parts (e.g. example.co.uk) than when dealing with a gTLD (example.com). The only solution that has occurred to me is to have a list of known TLDs and second level domains (e.g. co.uk) that are insufficiently specific, requiring a subdomain for additional specificity. The problem is that this requires maintenance as well as initial research. Does anyone have any suggestions for an alternative method to solve this problem? I'm currently using Addressable:URI (http://addressable.rubyforge.org/api/classes/Addressable/URI.html) to parse the URLs and extract the host names. -- Charles Calvert | Software Design/Development Celtic Wolf, Inc. | Project Management http://www.celticwolf.com/ | Technical Writing (703) 580-0210 | Research