Reputation: 1544
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
Upvotes: 2
Views: 2838
Reputation: 17944
As mentioned in the documentation:
Returns the IPv4 address or a string containing the unmodified hostname on failure.
So you are on a failure situation.
Upvotes: 4