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 8
8
//const getdns = require("getdns");
9
9
const getdns = require ( "../" ) ;
10
10
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
+
11
17
const options = {
12
18
// Request timeout time in milliseconds.
13
19
timeout : 5000 ,
@@ -41,7 +47,7 @@ const context = getdns.createContext(options);
41
47
// Last argument must be a callback.
42
48
// Returns a transaction id, which may be used to cancel the request.
43
49
/* 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 ) ;
45
51
/* eslint-disable no-unused-vars */
46
52
47
53
// Cancel a request.
You can’t perform that action at this time.
0 commit comments