maycolalvarez, creo que encontre 2 formas para hacerlo usando PHP, si tengo razon me gustaria que fueras el 1ero en darme algo de Karma.

forma1:
Código PHP:
function GetDomain($url)
{
$nowww = ereg_replace('www\.','',$url);
$domain = parse_url($nowww);
if(!empty($domain["host"]))
{
return $domain["host"];
} else
{
return $domain["path"];
}
}
forma2:
Código PHP:
<?php
// get host name from URL
preg_match("/^(http:\/\/)?([^\/]+)/i",
"http://www.php.net/index.html", $matches);
$host = $matches[2];
// get last two segments of host name
preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches);
echo "domain name is: {$matches[0]}\n";
/* Output is php.net */
?>
fuente de la informacion: http://corpocrat.com/2009/02/28/php-how-to-get-domain-hostname-from-url/