You are here

function getdnsattributes in Smart IP 6.2

Same name and namespace in other branches
  1. 7.2 includes/geoip.inc \getdnsattributes()

File

includes/geoip.inc, line 775

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() : '';
  $str = substr($str, 1, -1);
  return $str;
}