mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-04 05:19:12 -04:00
parent
80e46c9292
commit
2df93737e8
4 changed files with 139 additions and 1 deletions
68
src/tools/dns-queries/dns-queries.vue
Normal file
68
src/tools/dns-queries/dns-queries.vue
Normal file
|
@ -0,0 +1,68 @@
|
|||
<script setup lang="ts">
|
||||
import { combineTXT, query, wellknown } from 'dns-query';
|
||||
import types from './dns.records.types.json';
|
||||
|
||||
const type = ref('A');
|
||||
const name = ref('google.com');
|
||||
const answers = ref<string[]>([]);
|
||||
|
||||
async function queryDNS() {
|
||||
const endpoints = await wellknown.endpoints('doh');
|
||||
try {
|
||||
const response = await query({
|
||||
question: { type: type.value, name: name.value },
|
||||
}, {
|
||||
endpoints,
|
||||
});
|
||||
if (type.value === 'TXT') {
|
||||
answers.value = (response.answers || []).map(answer => `${answer.name} ${answer.type} ${combineTXT(answer.data as Uint8Array[])} (TTL=${answer.ttl})`);
|
||||
}
|
||||
else {
|
||||
answers.value = (response.answers || []).map(answer => `${answer.name} ${answer.type} ${answer.data} (TTL=${answer.ttl})`);
|
||||
}
|
||||
}
|
||||
catch (error: any) {
|
||||
answers.value = [error.toString()];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="name"
|
||||
label="Name"
|
||||
label-position="left"
|
||||
placeholder="Name to query"
|
||||
mb-2
|
||||
/>
|
||||
<c-select
|
||||
v-model:value="type"
|
||||
searchable
|
||||
label="DNS record type:"
|
||||
label-position="left"
|
||||
:options="Object.values(types).map(kv => ({ value: kv.value, label: `${kv.value}: ${kv.label}` }))"
|
||||
mb-2
|
||||
/>
|
||||
|
||||
<div flex justify-center>
|
||||
<c-button
|
||||
@click="queryDNS"
|
||||
>
|
||||
Send DNS query
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<c-card title="Query results">
|
||||
<textarea-copyable
|
||||
v-for="(answer, index) in answers"
|
||||
:key="index"
|
||||
:value="answer"
|
||||
word-wrap
|
||||
mb-2
|
||||
/>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
49
src/tools/dns-queries/dns.records.types.json
Normal file
49
src/tools/dns-queries/dns.records.types.json
Normal file
|
@ -0,0 +1,49 @@
|
|||
[
|
||||
{ "value": "A", "label": "Address record" },
|
||||
{ "value": "AAAA", "label": "IPv6 address record" },
|
||||
{ "value": "AFSDB", "label": "AFS database record" },
|
||||
{ "value": "APL", "label": "Address Prefix List" },
|
||||
{ "value": "CAA", "label": "Certification Authority Authorization" },
|
||||
{ "value": "CDNSKEY", "label": "CDNSKEY" },
|
||||
{ "value": "CDS", "label": "Child DS" },
|
||||
{ "value": "CERT", "label": "Certificate record" },
|
||||
{ "value": "CNAME", "label": "Canonical name record" },
|
||||
{ "value": "CSYNC", "label": "Child-to-Parent Synchronization" },
|
||||
{ "value": "DHCID", "label": "DHCP identifier" },
|
||||
{ "value": "DLV", "label": "DNSSEC Lookaside Validation record" },
|
||||
{ "value": "DNAME", "label": "Delegation name record" },
|
||||
{ "value": "DNSKEY", "label": "DNS Key record" },
|
||||
{ "value": "DS", "label": "Delegation signer" },
|
||||
{ "value": "EUI48", "label": "MAC address (EUI-48)" },
|
||||
{ "value": "EUI64", "label": "MAC address (EUI-64)" },
|
||||
{ "value": "HINFO", "label": "Host Information" },
|
||||
{ "value": "HIP", "label": "Host Identity Protocol" },
|
||||
{ "value": "HTTPS", "label": "HTTPS Binding" },
|
||||
{ "value": "IPSECKEY", "label": "IPsec Key" },
|
||||
{ "value": "KEY", "label": "Key record" },
|
||||
{ "value": "KX", "label": "Key Exchanger record" },
|
||||
{ "value": "LOC", "label": "Location record" },
|
||||
{ "value": "MX", "label": "Mail exchange record" },
|
||||
{ "value": "NAPTR", "label": "Naming Authority Pointer" },
|
||||
{ "value": "NS", "label": "Name server record" },
|
||||
{ "value": "NSEC", "label": "Next Secure record" },
|
||||
{ "value": "NSEC3", "label": "Next Secure record version 3" },
|
||||
{ "value": "NSEC3PARAM", "label": "NSEC3 parameters" },
|
||||
{ "value": "OPENPGPKEY", "label": "OpenPGP public key record" },
|
||||
{ "value": "PTR", "label": "PTR Resource Record" },
|
||||
{ "value": "RP", "label": "Responsible Person" },
|
||||
{ "value": "RRSIG", "label": "DNSSEC signature" },
|
||||
{ "value": "SIG", "label": "Signature" },
|
||||
{ "value": "SMIMEA", "label": "S/MIME cert association" },
|
||||
{ "value": "SOA", "label": "Start of [a zone of] authority record" },
|
||||
{ "value": "SRV", "label": "Service locator" },
|
||||
{ "value": "SSHFP", "label": "SSH Public Key Fingerprint" },
|
||||
{ "value": "SVCB", "label": "Service Binding" },
|
||||
{ "value": "TA", "label": "DNSSEC Trust Authorities" },
|
||||
{ "value": "TKEY", "label": "Transaction Key record" },
|
||||
{ "value": "TLSA", "label": "TLSA certificate association" },
|
||||
{ "value": "TSIG", "label": "Transaction Signature" },
|
||||
{ "value": "TXT", "label": "Text record" },
|
||||
{ "value": "URI", "label": "Uniform Resource Identifier" },
|
||||
{ "value": "ZONEMD", "label": "Message Digests for DNS Zones" }
|
||||
]
|
12
src/tools/dns-queries/index.ts
Normal file
12
src/tools/dns-queries/index.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { World } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'DNS Queries',
|
||||
path: '/dns-queries',
|
||||
description: 'Perform DNS Queries (over HTTPS)',
|
||||
keywords: ['dns', 'nslookup', 'queries'],
|
||||
component: () => import('./dns-queries.vue'),
|
||||
icon: World,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
});
|
|
@ -1,6 +1,7 @@
|
|||
import { tool as base64FileConverter } from './base64-file-converter';
|
||||
import { tool as base64StringConverter } from './base64-string-converter';
|
||||
import { tool as basicAuthGenerator } from './basic-auth-generator';
|
||||
import { tool as dnsQueries } from './dns-queries';
|
||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||
import { tool as macAddressGenerator } from './mac-address-generator';
|
||||
|
@ -143,7 +144,15 @@ export const toolsByCategory: ToolCategory[] = [
|
|||
},
|
||||
{
|
||||
name: 'Network',
|
||||
components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator],
|
||||
components: [
|
||||
ipv4SubnetCalculator,
|
||||
ipv4AddressConverter,
|
||||
ipv4RangeExpander,
|
||||
macAddressLookup,
|
||||
macAddressGenerator,
|
||||
ipv6UlaGenerator,
|
||||
dnsQueries,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Math',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue