Get a domain name's IP address with PHP
September 15th, 2009
No comments
It’s an easy to get the IP address for a domain name using PHP’s gethostbyname() and gethostbynamel() functions. Here in this post looks at some examples of using the gethostbyname() function in PHP to get a single IP address for a hostname.
Example domains used
Examples in this post use www.cnn.com and www.electrictoolbox.com. At the time of the writing of this post, www.cnn.com resolves to 4 possible IP addresses as follows: Read more…


