Error: Call to Undefined Function checkdnsrr()
If users cannot register and you see an error similar to this:
Call to undefined function checkdnsrr() in ajax_functions.php
this means the server PHP configuration cannot use the checkdnsrr() function.
What checkdnsrr() Does
checkdnsrr() is a PHP network function used to check DNS records for a domain.
In WPResidence, this function may be used during email validation to check if the domain part of an email address has valid DNS records. This helps reduce suspicious or invalid email addresses during registration.
Example:
user@example.com
The function can check if example.com has valid DNS records, such as MX records used for email.
Why This Error Happens
This error is related to the hosting/server PHP configuration.
It can happen if:
- the server is using an old or incomplete PHP configuration
- the PHP network functions are not available
- the function is disabled by the hosting provider
- the server cannot perform DNS checks correctly
When the function is not available, the registration process may stop because the email validation check cannot be completed.
Recommended Solution
The best solution is to contact your hosting provider and ask them to enable or restore support for the PHP checkdnsrr() function.
You can send this message to your hosting provider:
Hello,
My WordPress website shows this PHP error during user registration:
Call to undefined function checkdnsrr()
Please check the PHP configuration and confirm that the PHP checkdnsrr() function is available and working on my hosting account/server.
This function is needed for DNS/email domain validation.
Thank you.
PHP Documentation
You can also send your hosting provider the official PHP documentation link for this function:
https://www.php.net/manual/en/function.checkdnsrr.php
Important Note
We do not recommend deleting the code that uses checkdnsrr() from the theme files.
Editing theme core files is not recommended because:
- the change can be lost after a theme update
- it can remove an email validation check
- it can allow invalid or suspicious email addresses to register
- it can create other issues if the code is changed incorrectly
The correct fix is to solve the missing PHP function at hosting/server level.
If the Hosting Provider Cannot Enable It
If your hosting provider cannot enable or support checkdnsrr(), please ask them to explain why the function is unavailable on your server.
In that case, you may need to move the website to a hosting environment where standard PHP network functions are available.
Final Recommendation
For the best result, keep the email validation check active and ask the hosting provider to make checkdnsrr() available.
Once the PHP function is available again, user registration should work normally.