3 ms·
IP should NOT be an integer. IPv6 does not fit in a database integer. MySQL has functions to convert to bytes. Even better, use a database with a proper inet d
by ttfkam 5y ago
IP should NOT be an integer. IPv6 does not fit in a database integer. MySQL has functions to convert to bytes.
Even better, use a database with a proper inet datatype. That way you get correctness, space efficiency, and ability to intelligently index.
- _3u10 5y agoIn 2002 it definitely should have been an integer. In 2021 I’d recommend just turning off the IPv6 allocation or deleting it from DNS like this site does.
- miyuru 5y ago> In 2021 I’d recommend just turning off the IPv6 allocation or deleting it from DNS like this site does. This is the funniest IPv6 excuse I've heard on HN. https://ipv6excuses.com/ https://ipv6excuses.com/
- _3u10 5y agoThanks! I was really surprised to find it myself. I used HN in some sample code for analyzing how SSL tickets are reused and was surprised to see an IPv4 address come back.