Uhm, the domain name is part of the url. The easiest way is to use the “Uri” class of Mono / .NET. Something like this:
var uri = new System.Uri(Application.absoluteURL);
Debug.Log("The domain name is: " + uri.Host);
If you need to access the top, second, third, … level parts of the domain name independently, Just split them on the “.”
// C#
var uri = new System.Uri(Application.absoluteURL);
var parts = uri.Host.Split('.');
System.Array.Reverse(parts); // reverse the array to make the last element the first
for(var i = 0; i < parts.Length; i++)
{
Debug.Log("Level "+ i + " domain name:" + parts*);*
} In UnityScript it looks the same, but since UnityScript doesn’t have char-literals you have to use: var parts = uri.Host.Split(“.”[0]);