File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 88//const getdns = require("getdns");
99const getdns = require ( "../" ) ;
1010
11+ // Usage: node example-raw.js [hostname] [record type]
12+ // Usage: node example-raw.js hostname.example.com AAAA
13+ const hostname = process . argv [ 2 ] || "labs.verisigninc.com" ;
14+ const recordTypeCode = process . argv [ 3 ] || "A" ;
15+ const recordType = getdns [ "RRTYPE_" + recordTypeCode . toUpperCase ( ) ] ;
16+
1117const options = {
1218 // Request timeout time in milliseconds.
1319 timeout : 5000 ,
@@ -41,7 +47,7 @@ const context = getdns.createContext(options);
4147// Last argument must be a callback.
4248// Returns a transaction id, which may be used to cancel the request.
4349/* eslint-disable no-unused-vars */
44- const transactionId = context . general ( "labs.verisigninc.com" , getdns . RRTYPE_A , callback ) ;
50+ const transactionId = context . general ( hostname , recordType , callback ) ;
4551/* eslint-disable no-unused-vars */
4652
4753// Cancel a request.
You can’t perform that action at this time.
0 commit comments