Michel Michel - 29 days ago 9
ASP.NET (C#) Question

easy way to get the top level domain?

i want to get the domain extention (at least i hope it is called this way) from the site name the user is currently on.

so from www.bbc.co.uk it's co.uk and
www.google.com = .com
http://stackoverflow.com/questions/ask = .com

etc.

especially the ones with the double name (like co.uk) gives me headaches....

EDIT
as i understand from the comments, co.uk is not a top level domain? that makes life easier!
EDIT
new name (top level domain) in the title

Answer

It's called a toplevel domain (tld) but for the BBC that's just "uk", not "co.uk".

What you want does not follow a standard so you'll need a table to check 'potential' pseudo-tld's

Comments