Blackhole Pro traps and blocks bad bots via virtual blackhole. Behind the scenes, Blackhole Pro performs a “whois” lookup to help identify various aspects of the request. For example, each whois lookup returns the user agent, IP address, referrer, and other useful information. By default, whois lookups are provided by whois.arin.net via port 43 on the server. These default server and port values are well-tested and recommended for most setups. In some cases, depending on server configuration, it may be necessary to change the whois port and/or server. This quick tutorial shows how to do it..

New to WordPress? Check out this tutorial on how to add custom code to your WordPress site.

Change the port number

To change the port number used by Blackhole Pro (and free version) to make whois lookups, add the following code to your WordPress site:

function blackhole_whois_port($port) {
	
	return 43; // change port number
	
}
add_filter('blackhole_whois_port', 'blackhole_whois_port');

Once added, you can change the port number from 43 to whatever you would like.

Change the server

To change the server used by Blackhole Pro (and free version) to make whois lookups, add the following code to your WordPress site:

function blackhole_whois_server($server) {
	
	return 'whois.arin.net'; // change server
	
}
add_filter('blackhole_whois_server', 'blackhole_whois_server');

Once added, you can change the server from whois.arin.net to whatever you prefer.