I am checking current hosting IP of websites using
$ip = gethostbyname('domainname.com');
It Returns IP address of websites working well but for some domains it returns back the domain name
$ip = gethostbyname('domainname.com');
Returns:
domianname.com