dns,

Install Dig on Amazon Linux 2

Apr 29, 2022 · 1 min read · Post a comment
Install Dig on Amazon Linux 2

Yet another useful DNS tool besides nslookup is dig. It can be used through the Linux command line that offers a quick check of the DNS records.

Prerequisites

  • Amazon Linux 2
  • sudo access

Install Dig on Amazon Linux 2

Step 1. Update the Amazon Linux 2 system packages.

sudo yum update

Step 2. Install Dig.

sudo yum install bind-utils

Step 3. Verify the installation.

dig -v

Output:

DiG 9.11.4-P2-RedHat-9.11.4-26.P2.amzn2.5.2

Dig google.com:

dig google.com

Output:

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.amzn2.5.2 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35292
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com.			IN	A

;; ANSWER SECTION:
google.com.		168	IN	A	74.125.193.138
google.com.		168	IN	A	74.125.193.139
google.com.		168	IN	A	74.125.193.101
google.com.		168	IN	A	74.125.193.113
google.com.		168	IN	A	74.125.193.102
google.com.		168	IN	A	74.125.193.100

;; Query time: 68 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Apr 29 13:18:47 UTC 2022
;; MSG SIZE  rcvd: 135

Conclusion

Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.