How to determine if a user has a static IP address on a site?

Is there a good way to find out if a user has a static IP address? I want to be able to ID which users who come to my site have static IP addresses.

+6
javascript html php
source share
7 answers

No no. This is information that is only on this network.

+5
source share

As others have noted, there is no reliable way to determine if a given IP address is statically or dynamically distributed.

Perhaps you can get 90% of the way using the efforts of some of the anti-spam organizations, for example, Spamhaus PBL , the β€œList of Policy Blocks” is a database of IP address ranges that have been identified by responsible Internet providers as addresses that are not There must be direct sources of legitimate email. I suspect that the bulk of this list will be a living end-user for dial-up or consumer broadband services. This is only a heuristic - I am sure that PBL has static IP blocks and probably a lot of dynamic IP addresses that are not on it, but it is about as close as you are going to get without knowing each IP range owner policy.

+2
source share

If the user has switched on the maintenance mode, the system should record the user ip and from this point allow access only if the maintenance mode is disabled.

Above was what I needed for the website. Below I use:

<?php session_start(); if ($_SESSION[last_ip]!==$_SERVER[REMOTE_ADDR]) { $_SESSION[ips] = (!is_numeric($_SESSION[ips])) ? 1 : $_SESSION[ips] + 1; $_SESSION[last_ip] = $_SERVER[REMOTE_ADDR]; } if ($_SESSION[ips]===1) { echo "Static IP"; } else { echo "Dynamic IP"; } ?> 

According to the posted answers (long time ago, sry ') it is almost impossible to achieve this. For me it works ... if I get nothing.

+2
source share

A package will be delivered to your Apache client that simply tells you what the IP address is.

You can monitor IP addresses and see if they are reused, but static or dynamic parameters are discussed by the network to which it connects, and not by your website.

0
source share

Not really, only using empirical data, the same IP address is repeated - even when it does not guarantee the same user, if it does not match the user account or cookie, etc.

Regardless of whether the IP is static or dynamically distributed, this is not what can be requested.

0
source share

You might find that NAT exists because NAT "manages" the packets. I'm not sure how NAT works, I think it is based on the source port. But I think NAT can cripple other parts of the TCP header, such as lifetime, in a recognizable way. Not that NAT is a 100% guarantee that they have a dynamic IP, but it is often used with DHCP.

0
source share

this is possible using the applet.

You can create a Java applet and get the IP address of the local computer and $ _SERVER ['REMOTE_ADDR'] and math and determine if it has a static or dynamic ip

-one
source share

All Articles