-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresolve4.js
56 lines (56 loc) · 1.15 KB
/
resolve4.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module.exports = {
name: "resolve4",
ns: "dns",
title: "Resolve4",
description: "Resolves a domain (e.g. 'google.com') into an array of the record types specified by rrtype.",
phrases: {
active: "Resolving {{input.rrtype}} for {{input.domain}}"
},
ports: {
input: {
domain: {
type: "string",
format: "host",
title: "Domain"
},
rrtype: {
"enum": ["A",
"AAAA",
"CNAME",
"MX",
"NS",
"PTR",
"SRV",
"TXT"
],
title: "Resource Record Type",
description: "DNS record types stored in the zone files of the Domain Name System (DNS)"
}
},
output: {
results: {
type: "object"
}
}
},
dependencies: {
npm: {
dns: require('dns')
}
},
fn: function resolve4(input, $, output, state, done, cb, on, dns) {
var r = function() {
dns.resolve4($.domain, function resolve4Callback(results) {
cb({
results: results
});
});
}.call(this);
return {
output: output,
state: state,
on: on,
return: r
};
}
}