I noticed that when using long2ip on certain integers for IP addresses that many IP addresses were being listed as 127.255.255.255. Clearly the integers were hitting the 32 bit maximum integer of 2130706433.
So after setting the type for IP addresses in the database from int to bigint and tested inserting an IP of 255.255.255.255 the apparent maximum value turned out to be 4294967295 which is 11 characters in length. So I suppose this is a two fold question...
1.) If we're just talking IPV4 then is bigint with a limit of 11 the way to go?
2.) When taking IPV6 in to account how does this effect the optimal maximum length of integers?
- John