-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdig.html
More file actions
1176 lines (1054 loc) · 49.4 KB
/
Copy pathdig.html
File metadata and controls
1176 lines (1054 loc) · 49.4 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dig — DNS Lookup Tool — DevDunia</title>
<meta name="description" content="Live DNS lookup tool powered by Cloudflare DoH. Understand dig output, DNS record types, and how DNS resolution works. Free online dig alternative for developers.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://devdunia.com/dig.html">
<meta property="og:title" content="dig — DNS Lookup Tool — DevDunia">
<meta property="og:description" content="Live DNS lookup tool powered by Cloudflare DoH. Understand dig output, DNS record types cheat sheet, common dig commands, and how DNS resolution works.">
<meta property="og:image" content="https://devdunia.com/images/logo.png">
<link rel="icon" type="image/png" href="images/logo.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="stylesheet" href="css/comic.css">
<link href="https://fonts.googleapis.com/css2?family=Bangers&family=Comic+Neue:wght@400;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
<style>
/* ---- TODO migrate: page-specific overrides, not yet centralized in css/comic.css ---- */
.panel-header .panel-tag {
font-family: 'Space Mono', monospace;
font-size: .65rem;
font-weight: 700;
background: var(--yellow);
color: var(--ink);
padding: 2px 7px;
border-radius: 3px;
white-space: nowrap;
}
/* DIVIDER */
.divider {
border: none;
border-top: 3px solid var(--ink);
margin: 16px 0;
}
.btn-blue { background: var(--blue); color: #fff; }
/* INPUT ROW */
.input-row {
display: flex;
gap: 10px;
margin-bottom: 14px;
flex-wrap: wrap;
}
.comic-input {
flex: 1;
min-width: 200px;
background: #fff;
border: 3px solid var(--ink);
border-radius: 6px;
padding: 10px 14px;
font-family: 'Space Mono', monospace;
font-size: .85rem;
color: var(--ink);
box-shadow: 3px 3px 0 var(--ink);
outline: none;
}
.comic-input:focus { border-color: var(--blue); }
.comic-input::placeholder { color: #aaa; font-style: italic; }
.comic-select {
background: #fff;
border: 3px solid var(--ink);
border-radius: 6px;
padding: 10px 14px;
font-family: 'Space Mono', monospace;
font-size: .85rem;
color: var(--ink);
box-shadow: 3px 3px 0 var(--ink);
outline: none;
cursor: pointer;
}
.comic-select:focus { border-color: var(--blue); }
/* DNS OUTPUT BOX */
.dns-output-wrap {
position: relative;
margin-top: 14px;
}
.dns-result-box {
background: var(--ink);
border-radius: 6px;
padding: 16px 18px;
font-family: 'Space Mono', monospace;
font-size: .78rem;
line-height: 1.85;
color: #ccc;
min-height: 80px;
overflow-x: auto;
white-space: pre-wrap;
word-break: break-all;
}
.dns-result-box .dns-status-ok { color: var(--green); font-weight: 700; }
.dns-result-box .dns-status-err { color: var(--red); font-weight: 700; }
.dns-result-box .dns-section-hdr { color: var(--yellow); font-weight: 700; }
.dns-result-box .dns-rec-a { color: var(--green); }
.dns-result-box .dns-rec-aaaa { color: #5bc4f5; }
.dns-result-box .dns-rec-mx { color: var(--pink); }
.dns-result-box .dns-rec-ns { color: var(--purple); }
.dns-result-box .dns-rec-cname { color: var(--orange); }
.dns-result-box .dns-rec-txt { color: var(--blue); }
.dns-result-box .dns-rec-soa { color: #aaa; }
.dns-result-box .dns-rec-ptr { color: #c8a4ff; }
.dns-result-box .dns-rec-other { color: #ddd; }
.dns-result-box .dns-ttl { color: var(--yellow); }
.dns-result-box .dns-comment { color: #6a8a6a; }
.dns-result-box .dns-loading { color: var(--orange); }
/* ANNOTATED DIG OUTPUT */
.dig-output {
background: #1a1410;
border-radius: 6px;
padding: 18px 20px;
font-family: 'Space Mono', monospace;
font-size: .78rem;
line-height: 1.9;
overflow-x: auto;
white-space: pre;
}
.do-comment { color: #6a8a6a; }
.do-section { color: #ffd23f; font-weight: 700; }
.do-flag { color: #ff8c42; }
.do-record-a { color: #3fa34d; }
.do-record-ns { color: #8a4fff; }
.do-record-mx { color: #ff6b9d; }
.do-record-txt{ color: #1d6fb8; }
.do-ttl { color: #ffd23f; }
.do-stat { color: rgba(255,255,255,.55); }
/* ANNOTATION BLOCK */
.annotation {
background: var(--paper2);
border-left: 4px solid var(--blue);
border-radius: 0 6px 6px 0;
padding: 8px 14px;
margin: 6px 0 14px 0;
font-size: .82rem;
line-height: 1.5;
}
.annotation strong { font-family: 'Bangers', cursive; letter-spacing: .5px; font-size: .9rem; }
/* COLLAPSIBLE DETAILS */
details {
border: 3px solid var(--ink);
border-radius: 6px;
overflow: hidden;
margin-bottom: 14px;
box-shadow: 4px 4px 0 var(--ink);
}
details summary {
background: var(--paper2);
padding: 10px 14px;
font-family: 'Bangers', cursive;
font-size: 1rem;
letter-spacing: 1px;
cursor: pointer;
list-style: none;
display: flex;
align-items: center;
gap: 8px;
user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
content: '▶';
font-size: .7rem;
transition: transform .2s;
color: var(--blue);
}
details[open] summary::before { transform: rotate(90deg); }
details .details-body { padding: 14px 16px; }
/* CHEAT SHEET TABLE */
.comic-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 12px;
}
.comic-table th {
background: var(--ink);
color: var(--yellow);
font-family: 'Bangers', cursive;
font-size: 1rem;
letter-spacing: 1px;
padding: 8px 12px;
text-align: left;
border: 2px solid var(--ink);
}
.comic-table td {
padding: 7px 12px;
border: 2px solid var(--ink);
font-size: .83rem;
}
.comic-table tr:nth-child(even) td { background: var(--paper2); }
.comic-table tr:nth-child(odd) td { background: var(--paper); }
.comic-table code {
font-family: 'Space Mono', monospace;
font-size: .72rem;
background: var(--ink);
color: var(--yellow);
padding: 1px 5px;
border-radius: 3px;
white-space: nowrap;
}
/* TYPE BADGE */
.type-badge {
display: inline-block;
font-family: 'Bangers', cursive;
font-size: .85rem;
letter-spacing: 1px;
padding: 1px 8px;
border: 2px solid var(--ink);
border-radius: 4px;
box-shadow: 1px 1px 0 var(--ink);
white-space: nowrap;
}
/* COMMAND CARDS GRID */
.cmd-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.cmd-card {
background: var(--paper2);
border: 3px solid var(--ink);
border-radius: 6px;
box-shadow: 4px 4px 0 var(--ink);
padding: 12px 14px;
position: relative;
}
.cmd-card-command {
font-family: 'Space Mono', monospace;
font-size: .75rem;
color: var(--yellow);
background: var(--ink);
border-radius: 5px;
padding: 8px 48px 8px 12px;
margin-bottom: 8px;
word-break: break-all;
position: relative;
min-height: 36px;
display: flex;
align-items: center;
}
.cmd-copy-btn {
position: absolute;
top: 6px;
right: 6px;
font-family: 'Bangers', cursive;
font-size: .75rem;
letter-spacing: 1px;
background: var(--yellow);
color: var(--ink);
border: 2px solid var(--ink);
border-radius: 4px;
padding: 2px 7px;
cursor: pointer;
box-shadow: 1px 1px 0 rgba(0,0,0,.3);
transition: transform .1s;
white-space: nowrap;
}
.cmd-copy-btn:active { transform: translate(1px,1px); }
.cmd-card-desc {
font-size: .83rem;
line-height: 1.45;
}
.cmd-card-label {
font-family: 'Bangers', cursive;
font-size: .9rem;
letter-spacing: 1px;
margin-bottom: 6px;
}
.step-connector {
width: 3px;
height: 14px;
background: var(--ink);
margin-left: 12px;
border-radius: 2px;
opacity: .35;
}
/* SPEECH BUBBLE */
.speech-bubble {
position: relative;
background: var(--yellow);
border: 3px solid var(--ink);
border-radius: 12px;
padding: 12px 16px;
margin: 14px 0;
font-size: .9rem;
line-height: 1.5;
}
.speech-bubble::before {
content: '';
position: absolute;
bottom: -18px; left: 24px;
border-width: 18px 10px 0;
border-style: solid;
border-color: var(--ink) transparent transparent;
}
.speech-bubble::after {
content: '';
position: absolute;
bottom: -12px; left: 26px;
border-width: 14px 8px 0;
border-style: solid;
border-color: var(--yellow) transparent transparent;
}
/* STATS ROW */
.result-meta {
display: flex;
gap: 14px;
flex-wrap: wrap;
margin-bottom: 10px;
}
.result-chip {
font-family: 'Space Mono', monospace;
font-size: .68rem;
padding: 3px 9px;
border: 2px solid var(--ink);
border-radius: 4px;
box-shadow: 2px 2px 0 var(--ink);
display: flex;
align-items: center;
gap: 5px;
}
/* MOBILE */
@media (max-width: 760px) {
.page-wrap { padding: 16px 14px 48px; }
.cmd-grid { grid-template-columns: 1fr; }
.input-row { flex-direction: column; }
.comic-select { width: 100%; }
.comic-table { font-size: .75rem; }
.comic-table th, .comic-table td { padding: 5px 8px; }
.dig-output { font-size: .7rem; }
}
</style>
</head>
<body>
<div class="paper-overlay"></div>
<div data-masthead></div>
<div class="page-wrap">
<div data-tool-hero
data-title="dig"
data-chapter="09"
data-category="DNS Tools"
data-icon="🔍"
data-desc="Live DNS lookups via Cloudflare DoH, annotated dig output, a full record-type cheat sheet, and a visual walk-through of recursive DNS resolution. No install needed — dig from your browser!"
data-color="blue"
data-badges="DNS,DoH,LIVE LOOKUP,FREE"
data-badge-colors="blue,green,purple,yellow">
</div>
<!-- ═══════════════════════════════════════════════════════ -->
<!-- PANEL 1: LIVE DNS LOOKUP -->
<!-- ═══════════════════════════════════════════════════════ -->
<div class="panel">
<div class="panel-header">
🔍 LIVE DNS LOOKUP
<span class="panel-tag">INTERACTIVE</span>
</div>
<div class="panel-body">
<div class="section-label">Domain & Record Type</div>
<div class="input-row">
<input type="text" id="dns-domain" class="comic-input"
placeholder="e.g. devdunia.com" value="devdunia.com"
autocomplete="off" autocapitalize="none" spellcheck="false">
<select id="dns-type" class="comic-select">
<option value="A">A</option>
<option value="AAAA">AAAA</option>
<option value="MX">MX</option>
<option value="NS">NS</option>
<option value="CNAME">CNAME</option>
<option value="TXT">TXT</option>
<option value="SOA">SOA</option>
<option value="PTR">PTR</option>
</select>
<button id="dns-lookup-btn" class="btn btn-blue">⚡ LOOKUP</button>
<button id="dns-clear-btn" class="btn btn-neutral">🗑 CLEAR</button>
</div>
<div id="dns-error" class="error-bubble">
💥 <span id="dns-error-msg">Enter a domain name first!</span>
</div>
<div id="dns-result-area" style="display:none;">
<div class="result-meta" id="dns-meta"></div>
<div class="dns-output-wrap">
<div class="dns-result-box" id="dns-result-box"></div>
</div>
</div>
<div class="speech-bubble" style="margin-top:16px;">
<strong>ℹ️ Powered by Cloudflare DoH</strong> — queries go to
<code style="font-family:'Space Mono',monospace;background:var(--ink);color:var(--yellow);padding:1px 5px;border-radius:3px;font-size:.78rem;">cloudflare-dns.com/dns-query</code>
over HTTPS. No software needed — runs entirely in your browser!
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════ -->
<!-- PANEL 2: READING dig OUTPUT — ANNOTATED -->
<!-- ═══════════════════════════════════════════════════════ -->
<div class="panel">
<div class="panel-header">
📖 READING DIG OUTPUT — ANNOTATED
<span class="panel-tag">REFERENCE</span>
</div>
<div class="panel-body">
<p style="font-size:.9rem;line-height:1.5;margin-bottom:16px;">
<code style="font-family:'Space Mono',monospace;background:var(--ink);color:var(--yellow);padding:1px 5px;border-radius:3px;">dig</code>
output has a consistent structure across all record types. Once you learn to read one, you can read them all.
Click each section below to expand the annotated example.
</p>
<!-- Sub-example 1: A record -->
<details open>
<summary>🟢 Example 1 — <code style="font-family:'Space Mono',monospace;font-size:.8rem;">dig devdunia.com</code> (A record)</summary>
<div class="details-body">
<div class="dig-output"><span class="do-comment">; <<>> DiG 9.18.1 <<>> devdunia.com</span>
<span class="do-comment">;; global options: +cmd</span>
<span class="do-section">;; Got answer:</span>
<span class="do-comment">;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31415</span>
<span class="do-comment">;; flags: </span><span class="do-flag">qr rd ra</span><span class="do-comment">; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1</span>
<span class="do-section">;; QUESTION SECTION:</span>
<span class="do-comment">;devdunia.com. IN A</span>
<span class="do-section">;; ANSWER SECTION:</span>
<span class="do-record-a">devdunia.com. <span class="do-ttl">3600</span> IN A 185.199.108.153</span>
<span class="do-record-a">devdunia.com. <span class="do-ttl">3600</span> IN A 185.199.109.153</span>
<span class="do-record-a">devdunia.com. <span class="do-ttl">3600</span> IN A 185.199.110.153</span>
<span class="do-record-a">devdunia.com. <span class="do-ttl">3600</span> IN A 185.199.111.153</span>
<span class="do-stat">;; Query time: 18 msec</span>
<span class="do-stat">;; SERVER: 1.1.1.1#53(1.1.1.1)</span>
<span class="do-stat">;; WHEN: Sun Jun 15 10:00:00 UTC 2026</span>
<span class="do-stat">;; MSG SIZE rcvd: 105</span></div>
<div class="annotation">
<strong style="color:var(--orange);">① HEADER LINE</strong><br>
<code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">status: NOERROR</code> — the domain exists and DNS responded cleanly.
Other values: <strong>NXDOMAIN</strong> (domain doesn't exist), <strong>SERVFAIL</strong> (resolver problem), <strong>REFUSED</strong> (server declined).
</div>
<div class="annotation">
<strong style="color:var(--orange);">② FLAGS</strong> —
<code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">qr</code> = this is a Query Response,
<code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">rd</code> = Recursion Desired (client asked for full recursion),
<code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">ra</code> = Recursion Available (server supports it).
</div>
<div class="annotation">
<strong style="color:var(--green);">③ ANSWER SECTION</strong><br>
Format: <code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">name TTL class type data</code><br>
TTL = <strong>Time To Live</strong> in seconds — how long resolvers may cache this record.
3600 = 1 hour. GitHub Pages uses 4 IPs for load distribution.
</div>
<div class="annotation">
<strong style="color:var(--purple);">④ STATS</strong><br>
Query time shows round-trip latency to your resolver. Low = cached answer, high = fresh recursive lookup.
The SERVER line tells you which resolver answered (here, Cloudflare 1.1.1.1).
</div>
</div>
</details>
<!-- Sub-example 2: MX record -->
<details>
<summary>📧 Example 2 — <code style="font-family:'Space Mono',monospace;font-size:.8rem;">dig devdunia.com MX</code> (mail servers)</summary>
<div class="details-body">
<div class="dig-output"><span class="do-comment">; <<>> DiG 9.18.1 <<>> devdunia.com MX</span>
<span class="do-comment">;; global options: +cmd</span>
<span class="do-section">;; Got answer:</span>
<span class="do-comment">;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27183</span>
<span class="do-comment">;; flags: </span><span class="do-flag">qr rd ra</span><span class="do-comment">; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1</span>
<span class="do-section">;; QUESTION SECTION:</span>
<span class="do-comment">;devdunia.com. IN MX</span>
<span class="do-section">;; ANSWER SECTION:</span>
<span class="do-record-mx">devdunia.com. <span class="do-ttl">3600</span> IN MX 1 aspmx.l.google.com.</span>
<span class="do-record-mx">devdunia.com. <span class="do-ttl">3600</span> IN MX 5 alt1.aspmx.l.google.com.</span>
<span class="do-record-mx">devdunia.com. <span class="do-ttl">3600</span> IN MX 5 alt2.aspmx.l.google.com.</span>
<span class="do-record-mx">devdunia.com. <span class="do-ttl">3600</span> IN MX 10 alt3.aspmx.l.google.com.</span>
<span class="do-record-mx">devdunia.com. <span class="do-ttl">3600</span> IN MX 10 alt4.aspmx.l.google.com.</span>
<span class="do-stat">;; Query time: 24 msec</span>
<span class="do-stat">;; SERVER: 1.1.1.1#53(1.1.1.1)</span>
<span class="do-stat">;; WHEN: Sun Jun 15 10:00:00 UTC 2026</span>
<span class="do-stat">;; MSG SIZE rcvd: 162</span></div>
<div class="annotation">
<strong style="color:var(--pink);">MX PRIORITY NUMBERS</strong><br>
The number before the mail server hostname is the <strong>priority</strong> — lower number = higher preference.
Sending servers try priority 1 (<code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">aspmx.l.google.com</code>) first,
falling back to priority 5 and 10 servers only if the primary is unreachable.
</div>
<div class="annotation">
<strong style="color:var(--pink);">WHY MULTIPLE MX RECORDS?</strong><br>
Redundancy! If Google's primary mail server is down, email bounces to the next-priority servers.
Google Workspace (Gmail for business) always sets up multiple MX records for high availability.
</div>
</div>
</details>
<!-- Sub-example 3: NS record -->
<details>
<summary>📌 Example 3 — <code style="font-family:'Space Mono',monospace;font-size:.8rem;">dig devdunia.com NS</code> (nameservers)</summary>
<div class="details-body">
<div class="dig-output"><span class="do-comment">; <<>> DiG 9.18.1 <<>> devdunia.com NS</span>
<span class="do-comment">;; global options: +cmd</span>
<span class="do-section">;; Got answer:</span>
<span class="do-comment">;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14142</span>
<span class="do-comment">;; flags: </span><span class="do-flag">qr rd ra</span><span class="do-comment">; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1</span>
<span class="do-section">;; QUESTION SECTION:</span>
<span class="do-comment">;devdunia.com. IN NS</span>
<span class="do-section">;; ANSWER SECTION:</span>
<span class="do-record-ns">devdunia.com. <span class="do-ttl">86400</span> IN NS ns1.exampleregistrar.com.</span>
<span class="do-record-ns">devdunia.com. <span class="do-ttl">86400</span> IN NS ns2.exampleregistrar.com.</span>
<span class="do-section">;; AUTHORITY SECTION:</span>
<span class="do-comment">; (omitted — shown when answer comes from a non-authoritative resolver)</span>
<span class="do-stat">;; Query time: 12 msec</span>
<span class="do-stat">;; SERVER: 1.1.1.1#53(1.1.1.1)</span>
<span class="do-stat">;; WHEN: Sun Jun 15 10:00:00 UTC 2026</span>
<span class="do-stat">;; MSG SIZE rcvd: 90</span></div>
<div class="annotation">
<strong style="color:var(--purple);">NS RECORDS = WHO'S IN CHARGE?</strong><br>
Nameserver records tell the internet <strong>which servers hold the authoritative DNS records</strong> for this domain.
When you change your domain's nameservers (e.g. moving from GoDaddy to Cloudflare), you update these.
The TTL of 86400 = 24 hours — NS records are cached much longer than A records.
</div>
<div class="annotation">
<strong style="color:var(--purple);">AUTHORITY SECTION</strong><br>
When dig queries a non-authoritative resolver (like 1.1.1.1) and the answer is cached,
the AUTHORITY section is empty. If you query the authoritative server directly
(<code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">dig @ns1.exampleregistrar.com devdunia.com NS</code>),
you'll see it populated with SOA records.
</div>
</div>
</details>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════ -->
<!-- PANEL 3: DNS RECORD TYPES CHEAT SHEET -->
<!-- ═══════════════════════════════════════════════════════ -->
<div class="panel">
<div class="panel-header">
📋 DNS RECORD TYPES CHEAT SHEET
<span class="panel-tag">REFERENCE</span>
</div>
<div class="panel-body">
<p style="font-size:.88rem;line-height:1.5;margin-bottom:14px;">
DNS has over 30 record types — here are the ones you'll encounter daily as a developer.
</p>
<div style="overflow-x:auto;">
<table class="comic-table">
<thead>
<tr>
<th>Type</th>
<th>What it stores</th>
<th>Example use</th>
<th>dig command</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="type-badge" style="background:var(--green);color:#fff;">A</span></td>
<td>IPv4 address (32-bit)</td>
<td>Map domain → IP (e.g. 185.199.108.153)</td>
<td><code>dig example.com A</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:#5bc4f5;color:var(--ink);">AAAA</span></td>
<td>IPv6 address (128-bit)</td>
<td>Map domain → IPv6 (e.g. 2606:50c0::153)</td>
<td><code>dig example.com AAAA</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:var(--orange);color:var(--ink);">CNAME</span></td>
<td>Canonical name alias</td>
<td>www → example.com, CDN aliases</td>
<td><code>dig www.example.com CNAME</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:var(--pink);color:#fff;">MX</span></td>
<td>Mail server + priority</td>
<td>Email routing, Google Workspace setup</td>
<td><code>dig example.com MX</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:var(--purple);color:#fff;">NS</span></td>
<td>Authoritative nameservers</td>
<td>Who controls DNS for this domain</td>
<td><code>dig example.com NS</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:var(--blue);color:#fff;">TXT</span></td>
<td>Arbitrary text strings</td>
<td>SPF, DKIM, domain verification, DMARC</td>
<td><code>dig example.com TXT</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:#888;color:#fff;">SOA</span></td>
<td>Start of Authority metadata</td>
<td>Zone serial, refresh/retry times, admin email</td>
<td><code>dig example.com SOA</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:#c8a4ff;color:var(--ink);">PTR</span></td>
<td>Reverse DNS (IP → hostname)</td>
<td>Spam filtering, server identity checks</td>
<td><code>dig -x 8.8.8.8</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:var(--yellow);color:var(--ink);">SRV</span></td>
<td>Service location + port</td>
<td>VoIP, Minecraft, service discovery</td>
<td><code>dig _sip._tcp.example.com SRV</code></td>
</tr>
<tr>
<td><span class="type-badge" style="background:var(--red);color:#fff;">CAA</span></td>
<td>Allowed SSL/TLS CAs</td>
<td>Restrict which CAs can issue certs for domain</td>
<td><code>dig example.com CAA</code></td>
</tr>
</tbody>
</table>
</div>
<div class="speech-bubble">
<strong>💡 Pro Tip — TXT records are the Swiss army knife!</strong>
They're used for SPF (email auth), DKIM (signing keys), DMARC policies, Google Search Console verification,
GitHub Pages domain verification, and even some creative hacks like storing JSON config.
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════ -->
<!-- PANEL 4: COMMON dig COMMANDS -->
<!-- ═══════════════════════════════════════════════════════ -->
<div class="panel">
<div class="panel-header">
🚩 COMMON DIG COMMANDS
<span class="panel-tag">CHEAT SHEET</span>
</div>
<div class="panel-body">
<p style="font-size:.88rem;line-height:1.5;margin-bottom:16px;">
Click <strong>COPY</strong> on any card to copy the command to your clipboard.
Replace <code style="font-family:'Space Mono',monospace;font-size:.75rem;background:var(--ink);color:var(--yellow);padding:1px 5px;border-radius:3px;">example.com</code> with your domain.
</p>
<div class="cmd-grid">
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--green);">Basic A Lookup</div>
<div class="cmd-card-command">
dig example.com
<button class="cmd-copy-btn" data-cmd="dig example.com">COPY</button>
</div>
<div class="cmd-card-desc">Default query — returns the A (IPv4) record. The most common dig command.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--pink);">Mail Servers</div>
<div class="cmd-card-command">
dig example.com MX
<button class="cmd-copy-btn" data-cmd="dig example.com MX">COPY</button>
</div>
<div class="cmd-card-desc">Lists all mail exchange servers and their priorities for the domain.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--purple);">Nameservers</div>
<div class="cmd-card-command">
dig example.com NS
<button class="cmd-copy-btn" data-cmd="dig example.com NS">COPY</button>
</div>
<div class="cmd-card-desc">Shows which nameservers are authoritative for this domain.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--blue);">TXT Records</div>
<div class="cmd-card-command">
dig example.com TXT
<button class="cmd-copy-btn" data-cmd="dig example.com TXT">COPY</button>
</div>
<div class="cmd-card-desc">Reveals SPF, DKIM, DMARC policies, domain verification tokens and more.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--green);">Use Google DNS</div>
<div class="cmd-card-command">
dig @8.8.8.8 example.com
<button class="cmd-copy-btn" data-cmd="dig @8.8.8.8 example.com">COPY</button>
</div>
<div class="cmd-card-desc">Force the query through Google's public resolver. Useful to bypass your ISP's DNS cache.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--orange);">Use Cloudflare DNS</div>
<div class="cmd-card-command">
dig @1.1.1.1 example.com
<button class="cmd-copy-btn" data-cmd="dig @1.1.1.1 example.com">COPY</button>
</div>
<div class="cmd-card-desc">Query via Cloudflare's ultra-fast resolver. Often faster and more privacy-respecting than ISP DNS.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--yellow);-webkit-text-stroke:.3px var(--ink);">Short Output</div>
<div class="cmd-card-command">
dig +short example.com
<button class="cmd-copy-btn" data-cmd="dig +short example.com">COPY</button>
</div>
<div class="cmd-card-desc">Strips all headers — just prints the bare record data. Great for scripting.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--green);">Answer Only</div>
<div class="cmd-card-command">
dig +noall +answer example.com
<button class="cmd-copy-btn" data-cmd="dig +noall +answer example.com">COPY</button>
</div>
<div class="cmd-card-desc">Suppresses all sections except ANSWER. Cleaner than <code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">+short</code> — still shows TTL & type.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--purple);">Reverse DNS (PTR)</div>
<div class="cmd-card-command">
dig -x 185.199.108.153
<button class="cmd-copy-btn" data-cmd="dig -x 185.199.108.153">COPY</button>
</div>
<div class="cmd-card-desc">Reverse lookup — find the hostname for an IP. The <code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">-x</code> flag handles the in-addr.arpa conversion automatically.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--red);">All Record Types</div>
<div class="cmd-card-command">
dig example.com ANY
<button class="cmd-copy-btn" data-cmd="dig example.com ANY">COPY</button>
</div>
<div class="cmd-card-desc">Request all available record types in one query. Note: many resolvers now restrict ANY queries to prevent amplification attacks.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--orange);">Trace Resolution Path</div>
<div class="cmd-card-command">
dig +trace example.com
<button class="cmd-copy-btn" data-cmd="dig +trace example.com">COPY</button>
</div>
<div class="cmd-card-desc">Shows the full delegation chain: root → TLD → authoritative. Invaluable for debugging propagation issues.</div>
</div>
<div class="cmd-card">
<div class="cmd-card-label" style="color:var(--blue);">Check DNSSEC</div>
<div class="cmd-card-command">
dig example.com +dnssec
<button class="cmd-copy-btn" data-cmd="dig example.com +dnssec">COPY</button>
</div>
<div class="cmd-card-desc">Requests DNSSEC records (RRSIG, DNSKEY). Look for the <code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">ad</code> flag in the response header to confirm validation.</div>
</div>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════ -->
<!-- PANEL 5: HOW DNS RESOLUTION WORKS -->
<!-- ═══════════════════════════════════════════════════════ -->
<div class="panel">
<div class="panel-header">
🧠 HOW DNS RESOLUTION WORKS
<span class="panel-tag">DEEP DIVE</span>
</div>
<div class="panel-body">
<p style="font-size:.9rem;line-height:1.5;margin-bottom:18px;">
When you type <code style="font-family:'Space Mono',monospace;font-size:.78rem;background:var(--ink);color:var(--yellow);padding:1px 5px;border-radius:3px;">devdunia.com</code> in your browser, up to 7 layers
of caching and delegation fire before you get the IP — all in under 50ms. Here's how:
</p>
<div class="how-steps">
<div class="how-step">
<div class="step-dot" style="background:var(--blue);">1</div>
<p>
<strong>Browser Cache</strong> — The browser checks its own DNS cache first.
If you visited devdunia.com recently and the TTL hasn't expired, you get the IP instantly.
Chrome: <code>chrome://net-internals/#dns</code> to inspect.
</p>
</div>
<div class="step-connector"></div>
<div class="how-step">
<div class="step-dot" style="background:var(--green);">2</div>
<p>
<strong>OS Cache</strong> — Cache miss? The OS checks its own resolver cache
(<code>/etc/hosts</code> on Linux/Mac, the hosts file on Windows, plus the system resolver cache).
This is why <code>sudo dscacheutil -flushcache</code> helps after a DNS change on Mac.
</p>
</div>
<div class="step-connector"></div>
<div class="how-step">
<div class="step-dot" style="background:var(--orange);">3</div>
<p>
<strong>Recursive Resolver</strong> — Still no cached answer? The OS sends the query to your
configured DNS resolver (e.g. 1.1.1.1, 8.8.8.8, or your ISP's resolver).
This server does the heavy lifting — it's called "recursive" because it recurses through the
DNS hierarchy on your behalf.
</p>
</div>
<div class="step-connector"></div>
<div class="how-step">
<div class="step-dot" style="background:var(--red);">4</div>
<p>
<strong>Root Nameservers</strong> — If the recursive resolver doesn't have the answer cached,
it queries one of the 13 root nameserver clusters (a.root-servers.net → m.root-servers.net).
The root servers don't know the IP — but they know who does: the TLD nameservers.
</p>
</div>
<div class="step-connector"></div>
<div class="how-step">
<div class="step-dot" style="background:var(--purple);">5</div>
<p>
<strong>TLD Nameservers</strong> — The root server replies: "I don't know, but ask the
<code>.com</code> TLD nameservers." The resolver queries Verisign's
<code>.com</code> nameservers which respond with the domain's authoritative nameservers
(e.g. <code>ns1.yourregistrar.com</code>).
</p>
</div>
<div class="step-connector"></div>
<div class="how-step">
<div class="step-dot" style="background:var(--pink);">6</div>
<p>
<strong>Authoritative Nameserver</strong> — The resolver now queries <em>your domain's</em>
nameservers — the ones configured at your registrar (Cloudflare, Route 53, GoDaddy, etc.).
These servers hold the actual DNS zone file and return the definitive answer.
</p>
</div>
<div class="step-connector"></div>
<div class="how-step">
<div class="step-dot" style="background:var(--green);">7</div>
<p>
<strong>Answer Returned & Cached</strong> — The IP is returned all the way back up the
chain. The recursive resolver <strong>caches</strong> the answer for the record's TTL,
so future queries skip steps 4–6. Your browser renders the page. Total time: ~10–50ms for a
cached answer, ~100–400ms for a cold recursive lookup.
</p>
</div>
</div>
<div class="speech-bubble" style="margin-top:20px;">
<strong>🧪 Test it yourself!</strong> Run
<code style="font-family:'Space Mono',monospace;font-size:.78rem;background:var(--ink);color:var(--yellow);padding:1px 5px;border-radius:3px;">dig +trace devdunia.com</code>
in your terminal to watch the full delegation chain live — root servers, TLD servers, and
the authoritative answer, all in one command.
</div>
<hr class="divider">
<div class="section-label">Key concepts at a glance</div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:10px;">
<div style="background:var(--paper2);border:3px solid var(--ink);border-radius:6px;padding:12px 14px;box-shadow:3px 3px 0 var(--ink);">
<div style="font-family:'Bangers',cursive;font-size:1rem;letter-spacing:1px;color:var(--blue);margin-bottom:6px;">TTL (Time To Live)</div>
<p style="font-size:.83rem;line-height:1.45;">Seconds a record may be cached. Low TTL = faster propagation when you change records, but more DNS queries. Set TTL low before migration, raise it after.</p>
</div>
<div style="background:var(--paper2);border:3px solid var(--ink);border-radius:6px;padding:12px 14px;box-shadow:3px 3px 0 var(--ink);">
<div style="font-family:'Bangers',cursive;font-size:1rem;letter-spacing:1px;color:var(--orange);margin-bottom:6px;">DNS Propagation</div>
<p style="font-size:.83rem;line-height:1.45;">When you update a DNS record, old resolvers keep serving the cached version until TTL expires. "Propagation" just means waiting for caches worldwide to expire.</p>
</div>
<div style="background:var(--paper2);border:3px solid var(--ink);border-radius:6px;padding:12px 14px;box-shadow:3px 3px 0 var(--ink);">
<div style="font-family:'Bangers',cursive;font-size:1rem;letter-spacing:1px;color:var(--green);margin-bottom:6px;">DNSSEC</div>
<p style="font-size:.83rem;line-height:1.45;">DNS Security Extensions add cryptographic signatures to records, preventing cache poisoning attacks. Look for the <code style="font-family:'Space Mono',monospace;font-size:.72rem;background:var(--ink);color:var(--yellow);padding:1px 4px;border-radius:3px;">ad</code> (Authenticated Data) flag in dig output.</p>
</div>
<div style="background:var(--paper2);border:3px solid var(--ink);border-radius:6px;padding:12px 14px;box-shadow:3px 3px 0 var(--ink);">
<div style="font-family:'Bangers',cursive;font-size:1rem;letter-spacing:1px;color:var(--purple);margin-bottom:6px;">DoH / DoT</div>
<p style="font-size:.83rem;line-height:1.45;">DNS-over-HTTPS and DNS-over-TLS encrypt DNS queries so your ISP can't see what domains you're visiting. This tool uses Cloudflare DoH for all live lookups!</p>
</div>
</div>
</div>
</div>
</div><!-- /page-wrap -->
<script>
// ── DNS LOOKUP (Cloudflare DoH) ──────────────────────────────────────────
(function() {
var domainInput = document.getElementById('dns-domain');
var typeSelect = document.getElementById('dns-type');
var lookupBtn = document.getElementById('dns-lookup-btn');
var clearBtn = document.getElementById('dns-clear-btn');
var errorBubble = document.getElementById('dns-error');
var errorMsg = document.getElementById('dns-error-msg');
var resultArea = document.getElementById('dns-result-area');
var resultBox = document.getElementById('dns-result-box');
var metaRow = document.getElementById('dns-meta');
var TYPE_COLORS = {
A: 'dns-rec-a',
AAAA: 'dns-rec-aaaa',
MX: 'dns-rec-mx',
NS: 'dns-rec-ns',
CNAME: 'dns-rec-cname',
TXT: 'dns-rec-txt',
SOA: 'dns-rec-soa',
PTR: 'dns-rec-ptr',
};
// RFC 1035 type numbers → names
var TYPE_NAMES = {
1:'A', 2:'NS', 5:'CNAME', 6:'SOA', 12:'PTR',
15:'MX', 16:'TXT', 28:'AAAA', 33:'SRV', 35:'NAPTR',
255:'ANY', 257:'CAA'
};
// DNS response status codes
var RCODES = {0:'NOERROR', 1:'FORMERR', 2:'SERVFAIL', 3:'NXDOMAIN',
4:'NOTIMP', 5:'REFUSED', 6:'YXDOMAIN', 8:'NXRRSet',
9:'NOTAUTH', 10:'NOTZONE'};
function esc(s) {
return String(s)
.replace(/&/g,'&')
.replace(/</g,'<')
.replace(/>/g,'>');
}
function showError(msg) {
errorMsg.textContent = msg;
errorBubble.classList.add('show');
resultArea.style.display = 'none';
}
function hideError() { errorBubble.classList.remove('show'); }
function parseDNSData(answer) {
if (!answer) return '(no data)';
var d = answer.data;
if (!d) return '(no data)';
return d;
}
function getTypeName(num) {
return TYPE_NAMES[num] || ('TYPE' + num);
}
function renderRecord(rec) {
var typeName = typeof rec.type === 'string' ? rec.type : getTypeName(rec.type);
var cls = TYPE_COLORS[typeName] || 'dns-rec-other';
var data = esc(parseDNSData(rec));
var ttl = rec.TTL != null ? rec.TTL : '?';
var name = esc(rec.name || '');
var ttlSpan = '<span class="dns-ttl">' + ttl + '</span>';
// Extra formatting for MX (priority + exchange)
if (typeName === 'MX' && rec.data) {
var parts = rec.data.split(' ');
if (parts.length >= 2) {
data = '<span class="dns-ttl">' + esc(parts[0]) + '</span> <span class="' + cls + '">' + esc(parts.slice(1).join(' ')) + '</span>';
} else {
data = '<span class="' + cls + '">' + data + '</span>';
}
} else {
data = '<span class="' + cls + '">' + data + '</span>';
}
return name + ' ' + ttlSpan + ' IN ' + typeName + ' ' + data;
}