Exception: DNS error: (line 30, file "Code")
Exception: DNS error: (line 30, file "Code")
我正在尝试使用此电子表格:
https://kennymcnett.com/domain-name-checker-in-google-sheets/
我从 RapidAPI 获得了一个 API 密钥。
但是我收到以下错误消息:
Exception: DNS error: https://domainr.p.mashape.com/v2/status?mashape-key=f23.....25c5&domain=undefined (line 30, file "Code")
扩展的第 30 行是:
var result = UrlFetchApp.fetch(url+domain);
扩展中的所有代码:
// Works as of April 6, 2016
// domainr docs: http://domainr.build/docs/overview
// Get your free API key from https://market.mashape.com/domainr/domainr
// Create an application, get a key
// Put your key into the cell on the "Instructions" sheet
/* sample return JSON from domainr.p.mashape.com
*
* https://domainr.p.mashape.com/v2/status?mashape-key=YOURKEYHERE&domain=testasfkljhsdf.com
*
* Produces:
*
* {"status":[{"domain":"testasfkljhsdf.com","zone":"com","status":"undelegated inactive","summary":"inactive"}]}
*
*/
function domainLookup(domain) {
if (domain == "") {
return "N/A";
}
//Get the Key from cell A11 on the sheet named "Key"
var key = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Instructions').getRange('key').getValue(); //range = named range of the cell with the API key in it
//Submit to mashape
var url = "https://domainr.p.mashape.com/v2/status?mashape-key=" + key + "&domain=";
var result = UrlFetchApp.fetch(url+domain);
var out = JSON.parse(result.getContentText());
var answer = out.status[0].summary;
//Interpret the answer
if (answer == 'undelegated' || answer == 'inactive') {
var finalAnswer = "Available";
} else {
var finalAnswer = "Nope";
}
//Logger.log(out);
//Logger.log(finalAnswer);
//Show the answer
return finalAnswer;
}
这些是电子表格中的说明:
For more detailed instructions and other information about this document, see the write-up:
http://kennymcnett.com/domain-name-checker-in-google-sheets/
Instructions
Step 1
Make a copy of this document into your own Google Drive. Then, don't change anything on this sheet except the API Key
Step 2
Get a domainr.com API key from mashape.com
Step 3
Paste your domainr API key from mashape.com below:
f236......................................b0725c5
Step 4
Go to the Domain Names sheet and have fun!
Bonus
If you want to see the script code, go to "Tools > Script editor..."For more detailed instructions and other information about this document, see the write-up:
http://kennymcnett.com/domain-name-checker-in-google-sheets/
Instructions
Step 1
Make a copy of this document into your own Google Drive. Then, don't change anything on this sheet except the API Key
Step 2
Get a domainr.com API key from mashape.com
Step 3
Paste your domainr API key from mashape.com below:
f236.........................................25c5
Step 4
Go to the Domain Names sheet and have fun!
Bonus
If you want to see the script code, go to "Tools > Script editor..."
编辑:能够通过将 URL 更改为:
来解决此错误
domainr.p.rapidapi.com
但是在这样做之后,我现在收到一条新的错误消息:
Exception: Request failed for domainr.p.rapidapi.com returned code 403. Truncated server response: {"message":"You are not subscribed to this API."} (use muteHttpExceptions option to examine full response) (line 30).
到目前为止我所做的事情:
1. 确认我使用的 API 是免费的 API。根据此 URL,我使用的子域是此 api 的免费版本:
https://domainr.p.rapidapi.com (free or non-commercial use)
source: https://domainr.com/docs/api
- 我确认无需输入我的信用卡数据即可访问免费 api。根据此文档,免费 api 不需要我将信用卡信息输入我的 RapidAPI 帐户。
`
`
FREE APIs
RapidAPI has thousands of FREE APIs. As the name suggests, you can try
any of these APIs without providing credit card details. These APIs
are clearly marked as FREE.
Required Third-Party API Key
Occasionally you’ll need to acquire an API key or token from the
provider’s website.
`
source: https://docs.rapidapi.com/docs/api-pricing
我是 Domainr 的 Eric,请尝试使用 domainr.p.rapidapi.com
作为主机名(而不是 mashape
)——RapidAPI 最近出于某种原因弃用了 mashape
主机名。
我是 Kenny,您提到的博客 post 的作者。如果您仍然遇到问题,我已经更新了博客 post 以反映几项更改,这些更改将为您服务。 https://kennymcnett.com/domain-name-checker-in-google-sheets/
我正在尝试使用此电子表格:
https://kennymcnett.com/domain-name-checker-in-google-sheets/
我从 RapidAPI 获得了一个 API 密钥。
但是我收到以下错误消息:
Exception: DNS error: https://domainr.p.mashape.com/v2/status?mashape-key=f23.....25c5&domain=undefined (line 30, file "Code")
扩展的第 30 行是:
var result = UrlFetchApp.fetch(url+domain);
扩展中的所有代码:
// Works as of April 6, 2016
// domainr docs: http://domainr.build/docs/overview
// Get your free API key from https://market.mashape.com/domainr/domainr
// Create an application, get a key
// Put your key into the cell on the "Instructions" sheet
/* sample return JSON from domainr.p.mashape.com
*
* https://domainr.p.mashape.com/v2/status?mashape-key=YOURKEYHERE&domain=testasfkljhsdf.com
*
* Produces:
*
* {"status":[{"domain":"testasfkljhsdf.com","zone":"com","status":"undelegated inactive","summary":"inactive"}]}
*
*/
function domainLookup(domain) {
if (domain == "") {
return "N/A";
}
//Get the Key from cell A11 on the sheet named "Key"
var key = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Instructions').getRange('key').getValue(); //range = named range of the cell with the API key in it
//Submit to mashape
var url = "https://domainr.p.mashape.com/v2/status?mashape-key=" + key + "&domain=";
var result = UrlFetchApp.fetch(url+domain);
var out = JSON.parse(result.getContentText());
var answer = out.status[0].summary;
//Interpret the answer
if (answer == 'undelegated' || answer == 'inactive') {
var finalAnswer = "Available";
} else {
var finalAnswer = "Nope";
}
//Logger.log(out);
//Logger.log(finalAnswer);
//Show the answer
return finalAnswer;
}
这些是电子表格中的说明:
For more detailed instructions and other information about this document, see the write-up:
http://kennymcnett.com/domain-name-checker-in-google-sheets/
Instructions
Step 1
Make a copy of this document into your own Google Drive. Then, don't change anything on this sheet except the API Key
Step 2
Get a domainr.com API key from mashape.com
Step 3
Paste your domainr API key from mashape.com below:
f236......................................b0725c5
Step 4
Go to the Domain Names sheet and have fun!
Bonus
If you want to see the script code, go to "Tools > Script editor..."For more detailed instructions and other information about this document, see the write-up:
http://kennymcnett.com/domain-name-checker-in-google-sheets/
Instructions
Step 1
Make a copy of this document into your own Google Drive. Then, don't change anything on this sheet except the API Key
Step 2
Get a domainr.com API key from mashape.com
Step 3
Paste your domainr API key from mashape.com below:
f236.........................................25c5
Step 4
Go to the Domain Names sheet and have fun!
Bonus
If you want to see the script code, go to "Tools > Script editor..."
编辑:能够通过将 URL 更改为:
来解决此错误
domainr.p.rapidapi.com
但是在这样做之后,我现在收到一条新的错误消息:
Exception: Request failed for domainr.p.rapidapi.com returned code 403. Truncated server response: {"message":"You are not subscribed to this API."} (use muteHttpExceptions option to examine full response) (line 30).
到目前为止我所做的事情:
1. 确认我使用的 API 是免费的 API。根据此 URL,我使用的子域是此 api 的免费版本:
https://domainr.p.rapidapi.com (free or non-commercial use)
source: https://domainr.com/docs/api
- 我确认无需输入我的信用卡数据即可访问免费 api。根据此文档,免费 api 不需要我将信用卡信息输入我的 RapidAPI 帐户。 `
`
FREE APIs
RapidAPI has thousands of FREE APIs. As the name suggests, you can try any of these APIs without providing credit card details. These APIs are clearly marked as FREE.
Required Third-Party API Key
Occasionally you’ll need to acquire an API key or token from the provider’s website.
`
source: https://docs.rapidapi.com/docs/api-pricing
我是 Domainr 的 Eric,请尝试使用 domainr.p.rapidapi.com
作为主机名(而不是 mashape
)——RapidAPI 最近出于某种原因弃用了 mashape
主机名。
我是 Kenny,您提到的博客 post 的作者。如果您仍然遇到问题,我已经更新了博客 post 以反映几项更改,这些更改将为您服务。 https://kennymcnett.com/domain-name-checker-in-google-sheets/