Skip to content

New Components - viewdns_info #17742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import viewdnsInfo from "../../viewdns_info.app.mjs";

export default {
key: "viewdns_info-dns-record-lookup",
name: "DNS Record Lookup",
description: "Performs a DNS record lookup to retrieve various DNS record types for a domain. [See the documentation](https://viewdns.info/api/dns-record-lookup/)",
version: "0.0.1",
type: "action",
props: {
viewdnsInfo,
domain: {
type: "string",
label: "Domain",
description: "The hostname to retrieve DNS records for (e.g., example.com).",
},
recordType: {
type: "string",
label: "Record Type",
description: "The type of DNS record to retrieve (e.g., A,AAAA,MX,TXT,ANY).",
optional: true,
},
},
async run({ $ }) {
const response = await this.viewdnsInfo.dnsLookup({
$,
params: {
domain: this.domain,
recordtype: this.recordType,
},
});

$.export("$summary", `Retrieved DNS records for ${this.domain}.`);

return response;
},
};
29 changes: 29 additions & 0 deletions components/viewdns_info/actions/ip-history/ip-history.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import viewdnsInfo from "../../viewdns_info.app.mjs";

export default {
key: "viewdns_info-ip-history",
name: "IP History",
description: "Retrieves the IP address history for a domain. [See the documentation](https://viewdns.info/api/ip-history/)",
version: "0.0.1",
type: "action",
props: {
viewdnsInfo,
domain: {
type: "string",
label: "Domain",
description: "The domain name to retrieve the historical IP addresses for (e.g., example.com).",
},
},
async run({ $ }) {
const response = await this.viewdnsInfo.ipHistory({
$,
params: {
domain: this.domain,
},
});

$.export("$summary", `Retrieved IP history for ${this.domain}.`);

return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import viewdnsInfo from "../../viewdns_info.app.mjs";

export default {
key: "viewdns_info-reverse-ip-lookup",
name: "Reverse IP Lookup",
description: "Performs a reverse IP lookup to find domains hosted on the same IP address. [See the documentation](https://viewdns.info/api/reverse-ip-lookup/)",
version: "0.0.1",
type: "action",
props: {
viewdnsInfo,
host: {
type: "string",
label: "Host",
description: "The domain or IP to perform the reverse IP lookup on (e.g., example.com)",
},
},
async run({ $ }) {
const results = await this.viewdnsInfo.getPaginatedResources({
fn: this.viewdnsInfo.reverseIpLookup,
args: {
$,
params: {
host: this.host,
},
},
resourceKey: "domains",
});

$.export("$summary", `Found ${results.length} domain${results.length === 1
? ""
: "s"} hosted on the IP address.`);

return results;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import viewdnsInfo from "../../viewdns_info.app.mjs";

export default {
key: "viewdns_info-reverse-whois-lookup",
name: "Reverse Whois Lookup",
description: "Performs a reverse WHOIS search to find domains registered by the same person or organization. [See the documentation](https://viewdns.info/api/reverse-whois-lookup/)",
version: "0.0.1",
type: "action",
props: {
viewdnsInfo,
q: {
type: "string",
label: "Query",
description: "The registrant name or email address to search for (e.g., [email protected]).",
},
},
async run({ $ }) {
const results = await this.viewdnsInfo.getPaginatedResources({
fn: this.viewdnsInfo.reverseWhoisLookup,
args: {
$,
params: {
q: this.q,
},
},
resourceKey: "matches",
});

$.export("$summary", `Found ${results.length} domain${results.length === 1
? ""
: "s"} matching the query.`);

return results;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import viewdnsInfo from "../../viewdns_info.app.mjs";

export default {
key: "viewdns_info-subdomain-discovery",
name: "Subdomain Discovery",
description: "Discovers subdomains associated with a given domain. [See the documentation](https://viewdns.info/api/subdomain-discovery/)",
version: "0.0.1",
type: "action",
props: {
viewdnsInfo,
domain: {
type: "string",
label: "Domain",
description: "The domain name to retrieve subdomains for (e.g., example.com).",
},
},
async run({ $ }) {
const results = await this.viewdnsInfo.getPaginatedResources({
fn: this.viewdnsInfo.subdomainDiscovery,
args: {
$,
params: {
domain: this.domain,
},
},
resourceKey: "subdomains",
});

$.export("$summary", `Found ${results.length} subdomain${results.length === 1
? ""
: "s"} for ${this.domain}.`);

return results;
},
};
29 changes: 29 additions & 0 deletions components/viewdns_info/actions/whois-lookup/whois-lookup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import viewdnsInfo from "../../viewdns_info.app.mjs";

export default {
key: "viewdns_info-whois-lookup",
name: "Whois Lookup",
description: "Performs a WHOIS lookup to retrieve domain registration information. [See the documentation](https://viewdns.info/api/whois/)",
version: "0.0.1",
type: "action",
props: {
viewdnsInfo,
domain: {
type: "string",
label: "Domain",
description: "The domain or IP to perform a whois lookup on (e.g., example.com)",
},
},
async run({ $ }) {
const response = await this.viewdnsInfo.whoisLookup({
$,
params: {
domain: this.domain,
},
});

$.export("$summary", `Successfully retrieved WHOIS information for ${this.domain}`);

return response;
},
};
7 changes: 5 additions & 2 deletions components/viewdns_info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/viewdns_info",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream ViewDNS.info Components",
"main": "viewdns_info.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.1.0"
}
}
}
90 changes: 87 additions & 3 deletions components/viewdns_info/viewdns_info.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,95 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "viewdns_info",
propDefinitions: {},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.viewdns.info";
},
_makeRequest({
$ = this, path, params = {}, ...opts
}) {
return axios($, {
url: `${this._baseUrl()}${path}`,
params: {
...params,
apikey: `${this.$auth.api_key}`,
output: "json",
},
...opts,
});
},
whoisLookup(opts = {}) {
return this._makeRequest({
path: "/whois/v2",
...opts,
});
},
reverseWhoisLookup(opts = {}) {
return this._makeRequest({
path: "/reversewhois/",
...opts,
});
},
subdomainDiscovery(opts = {}) {
return this._makeRequest({
path: "/subdomains/",
...opts,
});
},
reverseIpLookup(opts = {}) {
return this._makeRequest({
path: "/reverseip/",
...opts,
});
},
ipHistory(opts = {}) {
return this._makeRequest({
path: "/iphistory/",
...opts,
});
},
dnsLookup(opts = {}) {
return this._makeRequest({
path: "/dnsrecord/",
...opts,
});
},
async *paginate({
fn, args, resourceKey, max,
}) {
args = {
...args,
params: {
...args?.params,
page: 1,
},
};
let totalPages, count = 0;
do {
const { response } = await fn(args);
const items = response[resourceKey];
if (!items?.length) {
return;
}
for (const item of items) {
yield item;
if (max && ++count >= max) {
return;
}
}
totalPages = +response.total_pages;
args.params.page++;
} while (totalPages > args.params.page);
},
async getPaginatedResources(opts) {
const results = [];
for await (const item of this.paginate(opts)) {
results.push(item);
}
return results;
},
},
};
Loading
Loading