{"id":25349,"date":"2024-02-29T13:39:58","date_gmt":"2024-02-29T13:39:58","guid":{"rendered":"https:\/\/linuxways.net\/?p=25349"},"modified":"2024-02-29T13:39:58","modified_gmt":"2024-02-29T13:39:58","slug":"install-use-dig-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/install-use-dig-debian-12\/","title":{"rendered":"How to Install and Use Dig on Debian 12"},"content":{"rendered":"<p><strong>Dig <\/strong>known as \u201cDomain Information Groper\u201d is a command that helps users with DNS-related tasks. It enables users to query DNS, check its configuration, collect information about it, troubleshoot network issues, and many more.<\/p>\n<p>By default, the \u201c<strong>dig<\/strong>\u201d utility comes pre-installed in all modern Linux distributions including Debian 12. However, if you do not find it on your system, you can easily install it via your system&#8217;s package manager. It will allow you to display information about the domain names, and verify DNS settings by querying different types of DNS records, etc.<\/p>\n<p>This post will illustrate the method to install and use \u201c<strong>dig<\/strong>\u201d on Debian 12.<\/p>\n<p><strong>Overview <\/strong><\/p>\n<ul>\n<li><a href=\"#post-25349-_e1zmuz17b4h\"><strong>How to Install Dig on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25349-_9rdgofxbnjcm\"><strong>How to Use Dig on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25349-_amckd34heci5\"><strong>How to Uninstall\/Remove Dig From Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25349-_f5xnzuaq7xkr\"><strong>Bonus Tip: Alternatives of Dig Command in Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25349-_av8to39dj1te\"><strong>Wrap Up<\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-25349-_e1zmuz17b4h\"><\/a>How to Install Dig on Debian 12<\/h2>\n<p>To install the \u201c<strong>dig<\/strong>\u201d command-line tool on Debian 12, you can install the \u201c<strong>dnsutils<\/strong>\u201d or \u201c<strong>bind9-dnsutils<\/strong>\u201d package from the default Debian repository. Both packages provide the necessary DNS tools for your system. Follow the given instructions to install \u201c<strong>dig<\/strong>\u201d on Debian 12:<\/p>\n<h3><a id=\"post-25349-_k7720vlz41x\"><\/a>Step 1: Update Debian System<\/h3>\n<p>First, update all the packages of your Debian system by utilizing the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> apt upgrade<\/div><\/div>\n<h3><a id=\"post-25349-_g5hl4n8ly4rm\"><\/a>Step 2: Install \u201cdig\u201d on Debian 12<\/h3>\n<p>Next, install the \u201c<strong>dnsutils<\/strong>\u201d package on Debian system that provides DNS-related tools, such as dig, host, and nslookup:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> dnsutils<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"427\" class=\"wp-image-25367\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-1.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-1-300x174.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p>Alternatively, you can also install the \u201c<strong>bind9-dnsutils<\/strong>\u201d package on your system. This package has the same tools as the \u201cdnsutils\u201d package but also includes the additional functions:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> bind9-dnsutils<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"449\" class=\"wp-image-25384\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-2.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-2-300x183.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-25349-_d0px09b5zpo5\"><\/a>Step 3: Verify Installation<\/h3>\n<p>Finally, check the version of \u201c<strong>dig<\/strong>\u201d to ensure its installation on the Debian 12 system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> <span class=\"re5\">-v<\/span><\/div><\/div>\n<p>The output displays the installed version of \u201c<strong>dig<\/strong>\u201d:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"112\" class=\"wp-image-25396\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-3.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-3-300x46.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<h2><a id=\"post-25349-_9rdgofxbnjcm\"><\/a>How to Use Dig on Debian 12<\/h2>\n<p>The \u201c<strong>dig<\/strong>\u201d command is used to perform various tasks, such as checking DNS records, resolving DNS problems, verifying DNS configurations, getting information about the domain name, and many more. To use the \u201c<strong>dig<\/strong>\u201d command on Debian 12, follow the provided sections.<\/p>\n<h3><a id=\"post-25349-_gwqgiyepe3s\"><\/a>Basic Syntax of \u201cdig\u201d Command<\/h3>\n<p>The basic syntax of the \u201c<strong>dig<\/strong>\u201d command is provided below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> <span class=\"br0\">&#91;<\/span>options<span class=\"br0\">&#93;<\/span> <span class=\"br0\">&#91;<\/span>name<span class=\"br0\">&#93;<\/span> <span class=\"br0\">&#91;<\/span><span class=\"kw3\">type<\/span><span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p>Here:<\/p>\n<ul>\n<li>\u201c<strong>options<\/strong>\u201d are the flags that are used to modify the \u201c<strong>dig<\/strong>\u201d command\u2019s behavior.<\/li>\n<li>\u201c<strong>name<\/strong>\u201d is the domain name or IP address you want to query.<\/li>\n<li>\u201c<strong>type<\/strong>\u201d specifies the DNS record type that needs to be queried.<\/li>\n<\/ul>\n<h3><a id=\"post-25349-_47stmb4329ud\"><\/a>Common Options of \u201cdig\u201d Command<\/h3>\n<p>The \u201c<strong>dig<\/strong>\u201d command has a lot of options that can be used to change its behavior. The below table displays some of the frequently used \u201c<strong>dig<\/strong>\u201d options:<\/p>\n<table>\n<thead>\n<tr>\n<th><strong>Option<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<\/tr>\n<tr>\n<th>+noall<\/th>\n<th>Clear all display flags<\/th>\n<\/tr>\n<tr>\n<th>+short<\/th>\n<th>Displays only the answer section and excludes additional information<\/th>\n<\/tr>\n<tr>\n<th>+additional<\/th>\n<th>Shows the additional section<\/th>\n<\/tr>\n<tr>\n<th>+authority<\/th>\n<th>Displays only the authority section<\/th>\n<\/tr>\n<tr>\n<th>+stats<\/th>\n<th>Prints the query statistics<\/th>\n<\/tr>\n<tr>\n<th>+answer<\/th>\n<th>Shows the answer section only.<\/th>\n<\/tr>\n<tr>\n<th>+nocomments<\/th>\n<th>Excludes the comments from the output<\/th>\n<\/tr>\n<tr>\n<th>+trace<\/th>\n<th>Shows the fill DNS delegation path<\/th>\n<\/tr>\n<tr>\n<th>+recurse<\/th>\n<th>Allow recursive querying<\/th>\n<\/tr>\n<tr>\n<th>-t<\/th>\n<th>Specifies the record type for a query<\/th>\n<\/tr>\n<\/thead>\n<\/table>\n<h3><a id=\"post-25349-_o7ofimh3oq92\"><\/a>DNS Record Type for \u201cdig\u201d Command<\/h3>\n<p>In the \u201c<strong>dig<\/strong>\u201d command, you can also specify the DNS record type that defines the type of information associated with the domain name. The commonly used DNS record types are listed in the below table:<\/p>\n<table>\n<thead>\n<tr>\n<th><strong>Record Type <\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<\/tr>\n<tr>\n<th>TXT (Text Record)<\/th>\n<th>Displays the descriptive text-type records<\/th>\n<\/tr>\n<tr>\n<th>A (IPv4 IP address)<\/th>\n<th>Translates the domain name to the IPv4 address<\/th>\n<\/tr>\n<tr>\n<th>MX (Mail Exchange)<\/th>\n<th>Specifies mail host servers<\/th>\n<\/tr>\n<tr>\n<th>AAAA (IPv6 IP address)<\/th>\n<th>Translates the domain name to the IPv6 address<\/th>\n<\/tr>\n<tr>\n<th>NS (Name Server)<\/th>\n<th>Indicates authentic DNS servers for the domain<\/th>\n<\/tr>\n<tr>\n<th>SRV (Service)<\/th>\n<th>Specifies the services\u2019 location in the domain<\/th>\n<\/tr>\n<tr>\n<th>PTR (Pointer Record)<\/th>\n<th>Define the domain name related to a particular IP address<\/th>\n<\/tr>\n<\/thead>\n<\/table>\n<h2><a id=\"post-25349-_t3oklsw3yttm\"><\/a>Using the \u201cdig\u201d Command in Debian 12<\/h2>\n<p>To use the \u201c<strong>dig<\/strong>\u201d command along with different options and DNS record types, check out the given use cases:<\/p>\n<ul>\n<li>Use Case 1: Perform a Basic DNS Query<\/li>\n<li>Use Case 2: Query For a Certain DNS Record Type<\/li>\n<li>Use Case 3: Query With a Particular DNS Server<\/li>\n<li>Use Case 4: Reverse DNS Lookup<\/li>\n<li>Use Case 5: Trace the DNS Path<\/li>\n<li>Use Case 6: Perform Multiple DNS Queries<\/li>\n<\/ul>\n<p><strong>Use Case 1: Perform a Basic DNS Query <\/strong><\/p>\n<p>To perform a basic query for a specific domain, use the \u201c<strong>dig<\/strong>\u201d command along with the desired domain name. For example, we are querying the \u201c<strong>linuxways.net<\/strong>\u201d domain as seen below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> linuxways.net<\/div><\/div>\n<p>In the below output:<\/p>\n<ul>\n<li>The first section displays the \u201c<strong>dig<\/strong>\u201d version installed on the system i.e. \u201c9.18.24-1-Debian\u201d and the \u201c<strong>HEADER<\/strong>\u201d section provides information about the query, such as its ID, opcode, status, etc.<\/li>\n<li>The second section provides information about the \u201c<strong>EDNS<\/strong>\u201d (Extended DNS) used in the query and the \u201c<strong>QUESTION SECTION<\/strong>\u201d indicates the domain being queried i.e. \u201clinuxways.net\u201d.<\/li>\n<li>The third section is the \u201c<strong>ANSWER SECTION<\/strong>\u201d which provides the actual response to the query. In our case, it indicates that \u201clinuxways.net\u201d has an \u201cA\u201d record of \u201c172.67.140.252\u201d and \u201c104.21.70.243\u201d IPv4 addresses.<\/li>\n<li>The fourth section displays the statistics information about the query including query time and server that provides the response, etc.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"531\" class=\"wp-image-25410\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-4.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-4-300x216.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>If you want to concise the output and display only the IP addresses associated with the specified domain, utilize the \u201c<strong>+short<\/strong>\u201d option in the \u201c<strong>dig<\/strong>\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> linuxways.net +short<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"135\" class=\"wp-image-25414\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-5.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-5-300x55.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p>Moreover, you can also use the \u201c<strong>+nocomments<\/strong>\u201d option to display the output without including any comments:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> linuxways.net +nocomments<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"323\" class=\"wp-image-25423\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-6.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-6-300x132.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p>Similarly, you can use various options to adjust the \u201c<strong>dig<\/strong>\u201d command\u2019s behavior.<\/p>\n<p><strong>Use Case 2: Query for a Certain Record Type<\/strong><\/p>\n<p>If you want to query for a particular record type, specify your desired record type in the \u201c<strong>dig<\/strong>\u201d command. For instance, we are displaying the \u201c<strong>TXT<\/strong>\u201d DNS record for \u201c<strong>linuxways.net<\/strong>\u201d:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> linuxways.net TXT<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"551\" class=\"wp-image-25429\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-7.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-7-300x224.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>Similarly, to query for the \u201c<strong>MX<\/strong>\u201d record type of a domain, write out the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> linuxways.net MX<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"530\" class=\"wp-image-25435\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-8.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-8-300x216.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p>Likewise, you can use the desired record type, such as AAAA, NS, or SRV to query the domain.<\/p>\n<p><strong>Use case 3: Query With a Particular DNS Server<\/strong><\/p>\n<p>You can also query a domain from a specific DNS server using the \u201c<strong>@<\/strong>\u201d symbol followed by the DNS server\u2019s IP address. Here, we are querying for the \u201c<strong>linuxways.net<\/strong>\u201d domain with \u201c<strong>8.8.8.8<\/strong>\u201d (Google DNS server):<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> <span class=\"sy0\">@<\/span>8.8.8.8 linuxways.net<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"552\" class=\"wp-image-25440\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-9.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-9-300x225.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p><strong>Use Case 4: Reverse DNS Lookup<\/strong><\/p>\n<p>To perform a reverse DNS lookup for finding the domain name associated with the specific IP address, type out the \u201c<strong>dig -x<\/strong>\u201d command followed by the particular IP address:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> <span class=\"re5\">-x<\/span> 104.21.70.243<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"533\" class=\"wp-image-25447\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-10.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-10-300x217.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p><strong>Use case 5: Trace the DNS Path<\/strong><\/p>\n<p>You can also trace the DNS lookup path by utilizing the \u201c<strong>+trace<\/strong>\u201d option in the \u201c<strong>dig<\/strong>\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> linuxways.net +trace<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"553\" class=\"wp-image-25454\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-11.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-11-300x225.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p><strong>Use Case 6: Perform Multiple DNS Queries<\/strong><\/p>\n<p>If you want to perform multiple DNS lookups at once, you can do it by following the provided instructions.<\/p>\n<p>First, create a text file using the \u201ctouch\u201d command and specify the particular file name:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">touch<\/span> DNS.txt<\/div><\/div>\n<p>Then, open the created \u201c.txt\u201d file in the editor:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">nano<\/span> DNS.txt<\/div><\/div>\n<p>In the \u201cDNS.txt\u201d file, add the certain domain names that you want to query by writing in each line:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"684\" height=\"408\" class=\"wp-image-25456\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-12.png 684w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-12-300x179.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-12-501x300.png 501w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/p>\n<p>Now, perform the batch queries by using the \u201c<strong>-f<\/strong>\u201d option in the \u201c<strong>dig<\/strong>\u201d command along with the text file i.e. \u201c<strong>DNS.txt<\/strong>\u201d having a list of domain names:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> <span class=\"re5\">-f<\/span> DNS.txt +short<\/div><\/div>\n<p>Here, we used the \u201c<strong>+short<\/strong>\u201d option for the concise output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"681\" height=\"179\" class=\"wp-image-25461\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-13.png 681w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-13-300x79.png 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/p>\n<h2><a id=\"post-25349-_amckd34heci5\"><\/a>How to Uninstall\/Remove Dig From Debian 12<\/h2>\n<p>To uninstall or remove \u201c<strong>dig<\/strong>\u201d from Debian 12, just remove the related installed package from your system. If you have installed the \u201c<strong>dnsutils<\/strong>\u201d package, you can remove it through the below-listed command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove dnsutils<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"298\" class=\"wp-image-25467\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-14.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-14-300x121.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p>If you have the \u201c<strong>bind9-dnsutils<\/strong>\u201d package installed, remove it as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove bind9-dnsutils<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"319\" class=\"wp-image-25476\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-15.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-15-300x130.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>To verify that \u201c<strong>dig<\/strong>\u201d has been successfully removed from the Debian 12 system, run any \u201c<strong>dig<\/strong>\u201d command as seen below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">dig<\/span> linuxways.net<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"114\" class=\"wp-image-25482\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-16.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-16-300x46.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<h2><a id=\"post-25349-_f5xnzuaq7xkr\"><\/a>Bonus Tip: Alternatives of Dig Command in Debian 12<\/h2>\n<p>In Debian 12, you can also use other alternative tools that perform similar functions as the \u201c<strong>dig<\/strong>\u201d. These tools include \u201c<strong>nslookup<\/strong>\u201d, \u201c<strong>host<\/strong>\u201d, \u201c<strong>drill<\/strong>\u201d, and \u201c<strong>dog<\/strong>\u201d.<\/p>\n<h3><a id=\"post-25349-_jh3q982q265w\"><\/a>Nslookup<\/h3>\n<p>The \u201c<strong>nslookup<\/strong>\u201d is a basic command-line utility for querying DNS servers and getting their information. You can use the \u201c<strong>nslookup<\/strong>\u201d command as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nslookup linuxways.net<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"363\" class=\"wp-image-25490\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-17.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-17-300x148.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p><strong>Note: <\/strong>For additional information about \u201cnslookup\u201d, <a href=\"https:\/\/linuxways.net\/de\/debian\/install-use-nslookup-on-debian-12\/\">Check Out Our Dedicated Post About It.<\/a><\/p>\n<h3><a id=\"post-25349-_k1qdm1oj5yob\"><\/a>Host<\/h3>\n<p>The \u201c<strong>host<\/strong>\u201d is another tool that is used for the quick DNS lookup. Here is how it works:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">host linuxways.net<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"219\" class=\"wp-image-25493\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-18.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-18-300x89.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-25349-_p90abv5hhju5\"><\/a>Drill<\/h3>\n<p>The \u201c<strong>drill<\/strong>\u201d is another best DNS lookup tool alternative to \u201c<strong>dig<\/strong>\u201d but it includes more advanced features. You can see its usage below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">drill linuxways.net<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"448\" class=\"wp-image-25497\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-19.png 740w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-19-300x182.png 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/p>\n<h3><a id=\"post-25349-_xy4v5cflzvc7\"><\/a>Dog<\/h3>\n<p>The \u201c<strong>dog<\/strong>\u201d is also a popular command-line tool having the functionalities of \u201chost\u201d and \u201cdig\u201d for looking up DNS records. It provides the simple output as seen here:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">dog linuxways.net<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"135\" class=\"wp-image-25499\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-20.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25349-20-300x55.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p>That was all about installing, using, and removing \u201c<strong>dig<\/strong>\u201d and its alternatives in Debian 12.<\/p>\n<h2><a id=\"post-25349-_av8to39dj1te\"><\/a>Wrap Up<\/h2>\n<p>To install the \u201c<strong>dig<\/strong>\u201d utility on Debian 12, install the \u201c<strong>dnsutils<\/strong>\u201d or \u201c<strong>bind9-dnsutils<\/strong>\u201d package from the default Debian repository through the \u201c<strong>sudo apt install &lt;package-name&gt;<\/strong>\u201d command. These packages provide DNS-related tools, such as dig, host, and nslookup for the system. You can use \u201c<strong>dig<\/strong>\u201d to get detailed information about DNS records, testing, verifying, and troubleshooting DNS, and many more. This post has illustrated the method to install, use, and remove \u201c<strong>dig<\/strong>\u201d on the Debian 12 system.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can install the Dig command-line utility from the default Debian repository using the \u201csudo apt install dnsutils\u201d command.<\/p>","protected":false},"author":112,"featured_media":25585,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-25349","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/112"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=25349"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25349\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/25585"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=25349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=25349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=25349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}