Jump to content

IP from Hostname


Asheeown

Recommended Posts

I'd recommend just trying this code to see if it works on your server to test if everything is working alright. Your server's DNS may be malfunctioning or the website.. physically.. example.com may not have a corresponding IP that can be parsed.

$ip = gethostbyname('www.google.com'); //Returns 74.125.127.104 for me.
echo $ip;

 

Link to comment
https://forums.phpfreaks.com/topic/172344-ip-from-hostname/#findComment-908724
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.