I want to have all ip(s) belonged to a domain, e.g. google.com, I recently have a look at this, https://github.com/ip2location/ip2location-cakephp. So, what I am going to do is likes this:
<?php
// clientIp() will iterate from 1.1.1.1 to 255.255.255.255
App::uses('IP2LocationCore', 'IP2Location.Model');
$IP2Location = new IP2LocationCore();
$record = $IP2Location->get($this->request->clientIp());
if(strcmp($record->domainName, 'google.com')) {
// log the ip to a text file
}
?>
My question is: is this solution feasible?, and anyway better than this?