-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.js
69 lines (50 loc) · 2.54 KB
/
functions.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
57
58
59
60
61
62
63
64
65
66
67
68
69
function pegarDNS() {
$("li").remove();
var url = document.getElementById('dominio').value
var settings = {
"async": true,
"crossDomain": true,
"url": "https://networkcalc.com/api/dns/lookup/"+url,
"method": "GET"
}
$.ajax(settings).done(function (response) {
if (response.records.A.length == 0) {
$( "#registros-a" ).append(`<li class="text-light"> Não possui </li>`);
}
if (response.records.CNAME.length == 0) {
$( "#registros-cname" ).append( `<li class="text-light"> Não possui </li>`);
}
if (response.records.MX.length == 0) {
$( "#registros-mx" ).append( `<li class="text-light"> Não possui </li>`);
}
if (response.records.NS.length == 0) {
$( "#registros-ns" ).append( `<li class="text-light"> Não possui </li>`);
}
if (response.records.SOA.length == 0) {
$( "#registros-soa" ).append( `<li class="text-light"> Não possui </li>`);
}
if (response.records.TXT.length == 0) {
$( "#registros-txt" ).append( `<li class="text-light"> Não possui </li>`);
}
for(var numero = 0; numero < response.records.A.length; numero++){
$( "#registros-a" ).append( `<li class="text-light">`+response.records.A[numero].address+`</li>`);
}
for(var numero = 0; numero < response.records.CNAME.length; numero++){
$( "#registros-cname" ).append( `<li class="text-light">`+response.records.CNAME[numero]+`</li>`);
}
for(var numero = 0; numero < response.records.MX.length; numero++){
$( "#registros-mx" ).append( `<li class="text-light">`+response.records.MX[numero].exchange+`</li>`);
}
for(var numero = 0; numero < response.records.NS.length; numero++){
$( "#registros-ns" ).append( `<li class="text-light">`+response.records.NS[numero].nameserver+`</li>`);
}
for(var numero = 0; numero < response.records.SOA.length; numero++){
$( "#registros-soa" ).append( `<li class="text-light">`+response.records.SOA[numero].hostmaster+`</li>`);
$( "#registros-soa" ).append( `<li class="text-light">`+response.records.SOA[numero].nameserver+`</li>`);
}
for(var numero = 0; numero < response.records.TXT.length; numero++){
$( "#registros-txt" ).append( `<li class="text-light">`+response.records.TXT[numero]+`</li>`);
}
}
);
}