Title: Getting error with gethostbyaddr()
Last modified: November 15, 2019

---

# Getting error with gethostbyaddr()

 *  Resolved [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/)
 * Hello,
 * I use version 2.7 and started getting an error everytime my wpcron runs.
 * It says: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /…./
   blackhole-helpers.php on line 39
 * It tried to reset the whole log since I thought there would be a bad IP, but 
   with no luck.
 * Any help ?
 * Thanks,
    Dragon013

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12135823)
 * Hello,
 * Glad to help. It’s a bug that will be fixed in the next plugin update. In the
   meantime you can stop the Warning by adding the following code:
 *     ```
       function blackhole_enable_host_check() { return false; }
       add_filter('blackhole_enable_host_check', 'blackhole_enable_host_check');
       ```
   
 * Thanks for reporting, Dragon013.
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12137080)
 * Thanks! It worked!
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12245256)
 * Just for your information
 * I updated the plugin today and the error was back. It was gone when I dropped
   all logged bots. So I guess a bad IP was in it. Sadly I did not copied the entries
   before but I remember a IPv6 which ended with “::”. Maybe that could be the cause?
 * I will keep an eye one it.
 * Edit: just while editing it I got the error again. There are only two bots in
   the log now.
 * – 2020/07/04 @ 12:00:00 am – 173.203.204.123 – HTTP/1.1 – Cygnus X-1 (Space Invaders)
   User Agent (Atari 2600)
    – [x] 2019/12/17 @ 07:18:05 am – 87.242.64.31 – HTTP/
   1.0 –
 * For the second one I got a mail with details. But after that my cronjob acts 
   up again with the said error message.
 * The quick bugfix you gave me should still sit in my functions.php since I did
   not remove it yet and as far as I know, plugins do not remove anything there ?
    -  This reply was modified 6 years, 5 months ago by [dragon013](https://wordpress.org/support/users/dragon013/).
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12247676)
 * As far as I know the suggested fix has resolved all reported errors so far. This
   may be something else happening, I’ll need to investigate further. And yes, the
   bugfix code should remain in place in order to work. Please check to make sure
   it has not been modified or removed.
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12249062)
 * I finally was able to check and noticed that the bugfix was gone from the functions.
   php. According to the net while updating a theme (I updated the wordpress theme
   2020) – Putting back the fix back in works like expected.
 * I was not aware that changes at functions.php were overwritten by a simple update.
   I put it into another place now and hope it will stay there.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12249069)
 * Yes that is correct: custom changes are overwritten when parent themes are updated.
   This is one reason why putting customizations in a child theme or simple plugin
   is recommended. Either way, glad you got it sorted [@dragon013](https://wordpress.org/support/users/dragon013/).
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12249079)
 * I do use a child theme actually but did forgot that there is a functions.php,
   too.
 * I guess now I will never forget it 😉
 * Thanks for your help!
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12562808)
 * Just to follow up with this, the `gethostbyaddr()` warning is resolved in the
   next plugin update. Should be available before WP 5.4 release. Thanks again for
   the feedback, [@dragon013](https://wordpress.org/support/users/dragon013/).
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12563327)
 * Great! And happy to be of help!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Getting error with gethostbyaddr()’ is closed to new replies.

 * ![](https://ps.w.org/blackhole-bad-bots/assets/icon-256x256.png?rev=1471215)
 * [Blackhole for Bad Bots](https://wordpress.org/plugins/blackhole-bad-bots/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/blackhole-bad-bots/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/blackhole-bad-bots/)
 * [Active Topics](https://wordpress.org/support/plugin/blackhole-bad-bots/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/blackhole-bad-bots/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/blackhole-bad-bots/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [dragon013](https://wordpress.org/support/users/dragon013/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/getting-error-with-gethostbyaddr/#post-12563327)
 * Status: resolved