Store IPs as longs, check directly against longs instead of getting all results. some more DI