What is the best way to store in a MySQL database multiple IP types like:
- Single IP (123.123.123.123)
- IP Ranges (123.123.123.1 - 123.123.123.121)
- IP blocks (123.123.123.1/20 )
- IP Classes (123.123.123.* or 123.123..)
I was thinking to transform all ranges/blocks/classes into single IP's and store them with ip2long for a faster search into the table, but this will result in a 1 million+ database also i need from time to time to reduce/enlarge the classes or to change/delete the IP blocks.
This database will be accessed every time someone access my website (so it needs to be quick). Any ideas?