function getdnsattributes in GeoIP API 7
Same name and namespace in other branches
- 6 lib/geoip.inc \getdnsattributes()
File
- lib/
geoip.inc, line 532
Code
function getdnsattributes($l, $ip) {
$r = new Net_DNS_Resolver();
$r->nameservers = array(
"ws1.maxmind.com",
);
$p = $r
->search($l . "." . $ip . ".s.maxmind.com", "TXT", "IN");
$str = is_object($p->answer[0]) ? $p->answer[0]
->string() : '';
ereg("\"(.*)\"", $str, $regs);
$str = $regs[1];
return $str;
}