ip-geo-block-dns

Specify the domain name server for reverse DNS lookup.

Description

The filter hook “ip-geo-block-dns” can replace the reverse DNS lookup service on your server if it is slow.

Parameters

Use case

The following code snippet in your theme’s functions.php can use APNIC public DNS resolver or Google public DNS resolver.

function my_gethostbyaddr( $resolvers ) {
    return array( '1.1.1.1', '1.0.0.1' ); // APNIC  public DNS (faster)
//  return array( '8.8.8.8', '8.8.4.4' ); // Google public DNS (slower)
}
add_filter( 'ip-geo-block-dns', 'my_gethostbyaddr' );
NOTE: When you select "mu-plugins" (ip-geo-block-mu.php) as Validation timing , you should put your code snippet into drop-in.php in Geolocation API folder instead of functions.php. See My custom functions in “functions.php” doesn’t work. in FAQ for detail.

Since

3.0.14