Title: Error when generating API key for site
Last modified: August 30, 2016

---

# Error when generating API key for site

 *  Resolved [anterys](https://wordpress.org/support/users/anterys/)
 * (@anterys)
 * [11 years ago](https://wordpress.org/support/topic/error-when-generating-api-key-for-site/)
 * We use this plugin for all of our sites and this is the first time we’re seeing
   the following error when attempting to generate an API key.
 * `Your domain xxxx does not seems to have a DNS A record so it will be considered
   as invalid by the API interface when you request the generation of a new key.
   Adding www at the beginning of the domain name may fix this issue.`
 * We use the www variant of the domain and use htaccess to redirect to this.
 * [https://wordpress.org/plugins/sucuri-scanner/](https://wordpress.org/plugins/sucuri-scanner/)

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

 *  [yorman](https://wordpress.org/support/users/yorman/)
 * (@yorman)
 * [11 years ago](https://wordpress.org/support/topic/error-when-generating-api-key-for-site/#post-6192221)
 * Yes, do not worry about that, you can still try to create the API with your current
   domain, but if the API service fails to generate the key you will know that this
   this is reason.
 * The plugin basically reverses the domain name to find its main IP address like
   this [1] and then compares the output of that function with the domain that was
   specified, if both values are the same the plugin considers that the DNS A record
   is missing and display the warning. If this is the case you can try to run the
   same code with the _“www”_ at the beginning of the domain like this [2] and you
   will probably find that the output is different.
 * Or if you know about Bash then you can use this script [3] that I wrote to generate
   an API for any domain. If you continue having issues contact us at [info@sucuri.net](https://wordpress.org/support/topic/error-when-generating-api-key-for-site/info@sucuri.net?output_format=md)
   and ask us to generate a key for your site _(you must specific the email address
   and domain name that you want to use to generate the API key)_.
 * [1] _gethostbyname(‘example.com’)_
    [2] _gethostbyname(‘www.example.com’)_ [3]
   [http://cixtor.com/pastio/f476kn](http://cixtor.com/pastio/f476kn)
 *  Thread Starter [anterys](https://wordpress.org/support/users/anterys/)
 * (@anterys)
 * [11 years ago](https://wordpress.org/support/topic/error-when-generating-api-key-for-site/#post-6192222)
 * Thanks for the tips Yorman. I am not sure I completely understand the issue. 
   If I ping both the www and non-www versions of the domain, the IP address is 
   the same. Not sure how the DNS setup I have for this domain is any different 
   than any of the other domains we manage.
 * I ran your script and received the same error (below) for both the www and non-
   www versions of the domain.
 * `{
    "action": "register_site", "messages": [ "Invalid domain. Not accepted." ],"
   output": {}, "request_time": 1433344337, "status": 0, "verbose": 0 }
 *  [yorman](https://wordpress.org/support/users/yorman/)
 * (@yorman)
 * [11 years ago](https://wordpress.org/support/topic/error-when-generating-api-key-for-site/#post-6192233)
 * When you say _“ping”_ you refer to the system command? Do you get the same IP
   address executing the _“host”_ [1] or _“dig”_ [2] commands?
 * Anyway, you can use that script to generate an API key any domain, obviously 
   people would prefer to associate the key to their real website but in this case
   it is not possible because the domain has no DNS A record, having the same IP
   address is not really relevant, the issue is that the A record is missing from
   the non-www domain.
 * Run the script once again, add your own email address _(the real one)_ and any
   domain like _“twitter.com”_ or whatever, no one else will be able to generate
   a key with that domain, and I do not think that people at Twitter are using this
   plugin so there will be no problem here.
 * [1] `host -s -t A -W 1 example.com`
    [2] `dig -t A +nocmd +noall +answer example.
   com`
 *  Thread Starter [anterys](https://wordpress.org/support/users/anterys/)
 * (@anterys)
 * [11 years ago](https://wordpress.org/support/topic/error-when-generating-api-key-for-site/#post-6192247)
 * The first command results in an error.
 *     ```
       ;; connection timed out; trying next origin
       Host xxxx.com not found: 3(NXDOMAIN)
       ```
   
 * The second does produce a good result, namely the correct IP address.
 * Ok. I have done your suggestion and it worked. Thanks for the prompt feedback.

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

The topic ‘Error when generating API key for site’ is closed to new replies.

 * ![](https://ps.w.org/sucuri-scanner/assets/icon-256x256.png?rev=2875755)
 * [Sucuri Security - Auditing, Malware Scanner and Security Hardening](https://wordpress.org/plugins/sucuri-scanner/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sucuri-scanner/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sucuri-scanner/)
 * [Active Topics](https://wordpress.org/support/plugin/sucuri-scanner/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sucuri-scanner/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sucuri-scanner/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [anterys](https://wordpress.org/support/users/anterys/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/error-when-generating-api-key-for-site/#post-6192247)
 * Status: resolved