Re: IP and gethostbyaddr() --- difference?
| From: | Ashley Sheridan | Date: | Sat, 13 Dec 2008 23:44:08 +0000 |
| Subject: | Re: IP and gethostbyaddr() --- difference? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284594@lists.php.net to get a copy of this message | ||
On Sun, 2008-12-14 at 00:28 +0100, Martin Zvarík wrote:
> Hello,
>
> I am doing a view stats for my website.
>
> I've seen that many of such statistic scripts store two values to
> identify the visitor: IP and getHostByAddr(IP)
>
> I've been searching..., but I don't get why the IP address isn't enough
> by itself?! What is the getHostByAddr() = Internet host name for?
>
> When IP changes the hostname does too and vice-versa?
>
> What's the difference between these two values?
> And why do I need both of them?
>
>
> Martin
>
The difference should be obvious, one is an IP address, the other is the
host for this IP address. It's really only useful where the IP address
is tied to an individual company, etc, as it's more meaningful than a
dotted decimal value!
Ash
www.ashleysheridan.co.uk