Knowledge

dig (command)

Source 📝

129: 1479: 25: 1501: 262:
dig is useful for network troubleshooting and for educational purposes. It can operate based on command line option and flag arguments, or in batch mode by reading requests from an operating system file. When a specific
681:
When originally written, the manual page for dig indicated that its name was an acronym for "Domain Information Groper". This expansion was removed in 2017; the tool's name is now simply "dig".
793: 867: 1537: 740: 108: 830: 605: 1492: 1487: 155: 46: 42: 267:
is not specified in the command invocation, it uses the operating system's default resolver, usually configured in the file
279: 89: 61: 1532: 860: 675: 151: 192: 68: 1464: 1434: 1449: 702: 488: 820:
Paul Albitz and Cricket Liu. DNS and BIND, 5th Edition. Nutshell Series. O'Reilly and Associates, Inc., 2006.
75: 35: 1505: 1210: 879: 853: 845: 765: 249: 222: 1527: 57: 1380: 1328: 207: 1053: 1043: 256: 840: 744: 252: 188: 476: 1280: 1185: 1180: 696: 217: 163: 1459: 1403: 1308: 1109: 1012: 674:
4 since at least 1990; later it was rewritten by Michael Sawyer, and is maintained by the
499:
Queries may be directed to designated DNS servers for specific records; in this example,
82: 1398: 1333: 1318: 1255: 1215: 1094: 1058: 952: 128: 1521: 1439: 1300: 1235: 1007: 982: 883: 272: 1413: 1313: 1230: 1225: 1129: 1038: 1002: 957: 453: 513:; <<>> DiG 9.11.3 <<>> wikimedia.org MX @ns0.wikimedia.org 1349: 1323: 1260: 1250: 1240: 1205: 1195: 1190: 1073: 1063: 1017: 713: 466: 294: 268: 264: 226: 24: 1165: 1124: 927: 897: 487:
queries do not enumerate multiple records, the only option is to request each
146: 136: 1454: 1408: 1388: 1285: 1265: 1220: 1068: 992: 977: 962: 947: 942: 937: 932: 500: 1370: 1150: 719: 290: 1175: 1099: 200: 196: 180: 176: 1160: 902: 522:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39041 172: 525:;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 342:;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0 339:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4016 297:; however, the older tools are still used in complementary fashion. 835: 699:– top-level name servers providing top level domain name resolution 1393: 1290: 1270: 1200: 1119: 1022: 997: 972: 922: 917: 912: 907: 708: 184: 168: 465:
DNS query is a special meta query which is now deprecated. Since
1444: 1418: 1354: 1275: 1170: 1155: 1114: 1104: 1048: 876: 722:, another utility that can be used to obtain similar information 690: 671: 608:
available. A common selection to make the output more terse is:
286: 849: 670:
dig was originally written by Steve Hotz and incorporated into
1245: 1145: 1089: 987: 18: 716:
is a simple utility for performing Domain Name System lookups
330:; <<>> DiG 9.6.1 <<>> example.com any 285:
dig is a component of the domain name server software suite
237: 967: 469:, most public DNS servers have stopped answering most DNS 705:– possible types of records stored and queried within DNS 456:
value, which indicates the time of validity of the data.
289:. dig supersedes in functionality older tools, such as 1427: 1379: 1363: 1342: 1299: 1138: 1082: 1031: 890: 233: 216: 206: 162: 145: 135: 49:. Unsourced material may be challenged and removed. 614:$ dig +noall +answer +multiline wikimedia.org MX 537:; COOKIE: c9735311d2d2fa6e3b334ab01b67960d (good) 528:;; WARNING: recursion requested but not available 861: 8: 588:;; SERVER: 208.80.154.238#53(208.80.154.238) 121: 348:;example.com. IN ANY 1500: 868: 854: 846: 543:;wikimedia.org. IN MX 509:$ dig wikimedia.org MX @ns0.wikimedia.org 310:In this example, dig is used to query for 127: 120: 316:type of record information in the domain 109:Learn how and when to remove this message 841:Dig source code in ISC Gitlab repository 836:How to use dig to query DNS name servers 16:Network administration command-line tool 732: 271:. Without any arguments it queries the 788: 786: 591:;; WHEN: Sat Sep 18 21:33:24 PDT 2021 534:; EDNS: version: 0, flags:; udp: 1024 491:(e.g. A, CNAME, or MX) individually. 7: 662:are simply output formatting flags. 47:adding citations to reliable sources 766:"Dig Command in Linux (DNS Lookup)" 14: 438:;; WHEN: Wed Aug 12 11:40:43 2009 1499: 1478: 1477: 831:Official BIND 9 man page for dig 23: 156:Computer Systems Research Group 34:needs additional citations for 1: 1538:Free network-related software 741:"LICENSE in Bind 9.11 branch" 280:Internationalized domain name 452:in the above example is the 676:Internet Systems Consortium 435:;; SERVER: ::1#53(::1) 152:Internet Systems Consortium 1554: 141:Steve Hotz, Michael Sawyer 1473: 659:+noall +answer +multiline 606:output formatting options 238:https://www.isc.org/bind/ 126: 703:List of DNS record types 610: 505: 322: 516:;; global options: +cmd 333:;; global options: +cmd 1493:Unix SUS2008 utilities 1488:Standard Unix programs 880:command-line interface 794:"dig (4.4BSD of 1990)" 600:With output formatting 594:;; MSG SIZE rcvd: 108 441:;; MSG SIZE rcvd: 154 326:$ dig example.com any 250:network administration 223:Mozilla Public License 651:mx2001.wikimedia.org. 633:mx1001.wikimedia.org. 585:;; Query time: 1 msec 582:mx2001.wikimedia.org. 564:mx1001.wikimedia.org. 531:;; OPT PSEUDOSECTION: 432:;; Query time: 1 msec 414:hostmaster.icann.org. 1381:Software development 540:;; QUESTION SECTION: 345:;; QUESTION SECTION: 43:improve this article 678:as part of BIND 9. 495:Specific DNS server 381:b.iana-servers.net. 366:a.iana-servers.net. 123: 1533:Domain Name System 546:;; ANSWER SECTION: 351:;; ANSWER SECTION: 257:Domain Name System 137:Original author(s) 58:"Dig" command 1515: 1514: 475:queries usefully 255:for querying the 253:command-line tool 243: 242: 119: 118: 111: 93: 1545: 1503: 1502: 1481: 1480: 1083:User environment 870: 863: 856: 847: 808: 807: 805: 804: 790: 781: 780: 778: 777: 762: 756: 755: 753: 752: 743:. Archived from 737: 697:Root name server 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 622: 619: 616: 615: 595: 592: 589: 586: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 523: 520: 517: 514: 511: 510: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 403: 400: 397: 394: 391: 388: 385: 382: 379: 376: 373: 370: 367: 364: 361: 358: 355: 352: 349: 346: 343: 340: 337: 334: 331: 328: 327: 293:and the program 164:Operating system 131: 124: 114: 107: 103: 100: 94: 92: 51: 27: 19: 1553: 1552: 1548: 1547: 1546: 1544: 1543: 1542: 1518: 1517: 1516: 1511: 1469: 1423: 1375: 1359: 1338: 1295: 1139:Text processing 1134: 1078: 1027: 886: 874: 827: 817: 812: 811: 802: 800: 798:man.freebsd.org 792: 791: 784: 775: 773: 764: 763: 759: 750: 748: 739: 738: 734: 729: 687: 668: 654: 653: 650: 647: 644: 641: 638: 635: 632: 629: 626: 623: 620: 617: 613: 612: 604:There are many 602: 597: 596: 593: 590: 587: 584: 581: 578: 575: 572: 569: 566: 563: 560: 557: 554: 551: 548: 545: 542: 539: 536: 533: 530: 527: 524: 521: 518: 515: 512: 508: 507: 497: 444: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 413: 411:dns1.icann.org. 410: 407: 404: 401: 398: 395: 392: 389: 386: 383: 380: 377: 374: 371: 368: 365: 362: 359: 356: 353: 350: 347: 344: 341: 338: 335: 332: 329: 325: 324: 308: 303: 282:(IDN) queries. 212:DNS lookup tool 115: 104: 98: 95: 52: 50: 40: 28: 17: 12: 11: 5: 1551: 1549: 1541: 1540: 1535: 1530: 1520: 1519: 1513: 1512: 1510: 1509: 1497: 1496: 1495: 1490: 1474: 1471: 1470: 1468: 1467: 1465:true and false 1462: 1457: 1452: 1447: 1442: 1437: 1431: 1429: 1425: 1424: 1422: 1421: 1416: 1411: 1406: 1401: 1396: 1391: 1385: 1383: 1377: 1376: 1374: 1373: 1367: 1365: 1361: 1360: 1358: 1357: 1352: 1346: 1344: 1340: 1339: 1337: 1336: 1331: 1326: 1321: 1316: 1311: 1305: 1303: 1301:Shell builtins 1297: 1296: 1294: 1293: 1288: 1283: 1278: 1273: 1268: 1263: 1258: 1253: 1248: 1243: 1238: 1233: 1228: 1223: 1218: 1213: 1208: 1203: 1198: 1193: 1188: 1183: 1178: 1173: 1168: 1163: 1158: 1153: 1148: 1142: 1140: 1136: 1135: 1133: 1132: 1127: 1122: 1117: 1112: 1107: 1102: 1097: 1092: 1086: 1084: 1080: 1079: 1077: 1076: 1071: 1066: 1061: 1056: 1051: 1046: 1041: 1035: 1033: 1029: 1028: 1026: 1025: 1020: 1015: 1010: 1005: 1000: 995: 990: 985: 980: 975: 970: 965: 960: 955: 950: 945: 940: 935: 930: 925: 920: 915: 910: 905: 900: 894: 892: 888: 887: 884:shell builtins 875: 873: 872: 865: 858: 850: 844: 843: 838: 833: 826: 825:External links 823: 822: 821: 816: 813: 810: 809: 782: 757: 731: 730: 728: 725: 724: 723: 717: 711: 706: 700: 694: 686: 683: 667: 664: 636:wikimedia.org. 618:wikimedia.org. 611: 601: 598: 567:wikimedia.org. 549:wikimedia.org. 519:;; Got answer: 506: 496: 493: 396:208.77.188.166 336:;; Got answer: 323: 307: 304: 302: 299: 241: 240: 235: 231: 230: 220: 214: 213: 210: 204: 203: 166: 160: 159: 149: 143: 142: 139: 133: 132: 117: 116: 31: 29: 22: 15: 13: 10: 9: 6: 4: 3: 2: 1550: 1539: 1536: 1534: 1531: 1529: 1526: 1525: 1523: 1508: 1507: 1498: 1494: 1491: 1489: 1486: 1485: 1484: 1476: 1475: 1472: 1466: 1463: 1461: 1458: 1456: 1453: 1451: 1448: 1446: 1443: 1441: 1438: 1436: 1433: 1432: 1430: 1428:Miscellaneous 1426: 1420: 1417: 1415: 1412: 1410: 1407: 1405: 1402: 1400: 1397: 1395: 1392: 1390: 1387: 1386: 1384: 1382: 1378: 1372: 1369: 1368: 1366: 1364:Documentation 1362: 1356: 1353: 1351: 1348: 1347: 1345: 1341: 1335: 1332: 1330: 1327: 1325: 1322: 1320: 1317: 1315: 1312: 1310: 1307: 1306: 1304: 1302: 1298: 1292: 1289: 1287: 1284: 1282: 1279: 1277: 1274: 1272: 1269: 1267: 1264: 1262: 1259: 1257: 1254: 1252: 1249: 1247: 1244: 1242: 1239: 1237: 1234: 1232: 1229: 1227: 1224: 1222: 1219: 1217: 1214: 1212: 1209: 1207: 1204: 1202: 1199: 1197: 1194: 1192: 1189: 1187: 1184: 1182: 1179: 1177: 1174: 1172: 1169: 1167: 1164: 1162: 1159: 1157: 1154: 1152: 1149: 1147: 1144: 1143: 1141: 1137: 1131: 1128: 1126: 1123: 1121: 1118: 1116: 1113: 1111: 1108: 1106: 1103: 1101: 1098: 1096: 1093: 1091: 1088: 1087: 1085: 1081: 1075: 1072: 1070: 1067: 1065: 1062: 1060: 1057: 1055: 1052: 1050: 1047: 1045: 1042: 1040: 1037: 1036: 1034: 1030: 1024: 1021: 1019: 1016: 1014: 1011: 1009: 1006: 1004: 1001: 999: 996: 994: 991: 989: 986: 984: 981: 979: 976: 974: 971: 969: 966: 964: 961: 959: 956: 954: 951: 949: 946: 944: 941: 939: 936: 934: 931: 929: 926: 924: 921: 919: 916: 914: 911: 909: 906: 904: 901: 899: 896: 895: 893: 889: 885: 882:programs and 881: 878: 871: 866: 864: 859: 857: 852: 851: 848: 842: 839: 837: 834: 832: 829: 828: 824: 819: 818: 814: 799: 795: 789: 787: 783: 771: 767: 761: 758: 747:on 2021-08-22 746: 742: 736: 733: 726: 721: 718: 715: 712: 710: 707: 704: 701: 698: 695: 692: 689: 688: 684: 682: 679: 677: 673: 665: 663: 661: 660: 609: 607: 599: 504: 502: 494: 492: 490: 486: 485: 479: 477: 474: 473: 468: 464: 463: 457: 455: 451: 450: 321: 319: 315: 314: 305: 301:Example usage 300: 298: 296: 292: 288: 283: 281: 278:dig supports 276: 274: 273:DNS root zone 270: 266: 260: 258: 254: 251: 247: 239: 236: 232: 228: 224: 221: 219: 215: 211: 209: 205: 202: 198: 194: 190: 186: 182: 178: 174: 170: 167: 165: 161: 157: 153: 150: 148: 144: 140: 138: 134: 130: 125: 113: 110: 102: 91: 88: 84: 81: 77: 74: 70: 67: 63: 60: –  59: 55: 54:Find sources: 48: 44: 38: 37: 32:This article 30: 26: 21: 20: 1528:DNS software 1504: 1482: 815:Bibliography 801:. Retrieved 797: 774:. Retrieved 772:. 2020-02-26 770:linuxize.com 769: 760: 749:. Retrieved 745:the original 735: 680: 669: 658: 657: 655: 603: 498: 483: 482: 480: 471: 470: 461: 460: 458: 454:time to live 448: 447: 445: 399:example.com. 384:example.com. 369:example.com. 354:example.com. 317: 312: 311: 309: 284: 277: 261: 245: 244: 229:before 9.11) 154:(originally 147:Developer(s) 105: 96: 86: 79: 72: 65: 53: 41:Please help 36:verification 33: 891:File system 693:name server 489:record type 467:around 2019 446:The number 318:example.com 269:resolv.conf 265:name server 227:ISC license 1522:Categories 1483:Categories 803:2024-05-17 776:2024-03-07 751:2021-09-19 727:References 501:MX records 417:2007051703 99:April 2011 69:newspapers 1343:Searching 1032:Processes 1151:basename 720:nslookup 685:See also 291:nslookup 1256:strings 1176:dirname 1100:logname 1049:crontab 666:History 426:1209600 259:(DNS). 234:Website 218:License 201:OpenVMS 197:illumos 193:Solaris 189:Windows 181:OpenBSD 177:FreeBSD 83:scholar 1236:printf 1161:csplit 903:chattr 656:Where 449:172719 402:172719 387:172719 372:172719 357:172719 173:NetBSD 85:  78:  71:  64:  56:  1460:sleep 1414:strip 1394:ctags 1329:unset 1309:alias 1291:xargs 1271:troff 1231:patch 1226:paste 1201:iconv 1130:write 1120:uname 1023:umask 1013:touch 1003:split 998:rmdir 973:mkdir 958:fuser 923:cksum 918:chgrp 913:chown 908:chmod 709:whois 429:86400 306:Basic 248:is a 185:macOS 169:Linux 90:JSTOR 76:books 1506:List 1445:expr 1419:yacc 1404:make 1355:grep 1350:find 1334:wait 1324:test 1319:echo 1276:uniq 1261:tail 1251:sort 1241:read 1216:more 1206:join 1196:head 1191:fold 1171:diff 1156:comm 1115:tput 1110:talk 1105:mesg 1095:exit 1074:time 1064:nice 1059:kill 1018:type 953:file 877:Unix 714:host 691:BIND 672:BIND 639:3600 621:3600 570:3600 552:3600 459:The 423:3600 420:7200 295:host 287:BIND 208:Type 62:news 1440:cal 1399:lex 1371:man 1246:sed 1166:cut 1146:awk 1125:who 1090:env 1008:tee 988:pwd 983:pax 928:cmp 898:cat 484:ANY 481:If 472:ANY 462:any 408:SOA 313:any 246:dig 122:dig 45:by 1524:: 1455:od 1450:lp 1435:bc 1409:nm 1389:ar 1314:cd 1286:wc 1281:vi 1266:tr 1221:nl 1211:m4 1186:ex 1181:ed 1069:ps 1054:fg 1044:bg 1039:at 993:rm 978:mv 968:ls 963:ln 948:df 943:du 938:dd 933:cp 796:. 785:^ 768:. 648:50 645:MX 642:IN 630:10 627:MX 624:IN 579:50 576:MX 573:IN 561:10 558:MX 555:IN 503:: 478:. 405:IN 390:IN 378:NS 375:IN 363:NS 360:IN 320:: 275:. 199:, 195:, 191:, 187:, 183:, 179:, 175:, 171:, 869:e 862:t 855:v 806:. 779:. 754:. 393:A 225:( 158:) 112:) 106:( 101:) 97:( 87:· 80:· 73:· 66:· 39:.

Index


verification
improve this article
adding citations to reliable sources
"Dig" command
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message

Original author(s)
Developer(s)
Internet Systems Consortium
Computer Systems Research Group
Operating system
Linux
NetBSD
FreeBSD
OpenBSD
macOS
Windows
Solaris
illumos
OpenVMS
Type
License
Mozilla Public License
ISC license

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.