I have made a visitor tracking script for my demo server. I want to add a rule so that my own page hits are not recorded.

But the problem is, I don't have a static IP. I have a DSL connection with dynamic IP. I thought I might be able to specify a range instead of a single IP.

If my IP at the moment is aaa.bbb.ccc.ddd, how safe is it to assume all IP addresses in the range aaa.bbb.ccc.0 to aaa.bbb.ccc.255 belong to my ISP and would eventually be assigned to me over time?

If this method is not reliable, what alternatives are there?

  • Perhaps you should use blocking cookies instead. That's how it's generally done by tracking services. – John Gardeniers Apr 7 '11 at 1:49
  • @ John Gardeniers - Thanks, yes. Ekevoo's solution is using cookies too ;) – Majid Fouladpour Apr 7 '11 at 1:56

If you run over https, consider using client certificates.

If you don't, set up a protected page that will give you a don't-count-my-hits cookie.

I'm assuming you have full control over your page-hit count mechanism. :)


Have your visitor tracking script not count the hit if a special string or code is present in the user agent, and modify your user agent accordingly.

  • Interesting solution. The problem though is that I use a wide array of browsers (to ensure cross-browser compatibility) and it would be hard to change ua on all - besides, some are so dumb they'd not give way easily (clue: think ie!). – Majid Fouladpour Apr 7 '11 at 1:15

Have you tried asking your ISP? the ranges owned by them will be no secret I'm sure they will tell you. It is possible to find the IP ranges associated with an ASN. however it's unlikely that you could be assigned any IP of the ip's owned by the ISP, so asking is better.

  • Thanks, I have tried that. As you say this should be no secrete, but they don't think so. – Majid Fouladpour Apr 7 '11 at 1:11
  • Alternatively, if you have a Linux box handy, do a whois on your current IP and it should tell you at least one of your ISP's netblocks. There's online utilities that do whois lookups as well. – LawrenceC Apr 7 '11 at 2:54

IP4 address is formated as a.b.c.d; a.b.c (Network ID format) is usually given uniquely to you by your Internet provider. d is usually reserved for subnets (Host ID format) within your network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.