Michel Michel - 2 months ago 15
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


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

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


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