dig: Difference between revisions
From Leechfinger
Jump to navigationJump to search
Line 35: | Line 35: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Look at the "ANSWER SECTION", it has name, TTL in seconds, IN (class or internet), A (record type), IP. | Look at the "ANSWER SECTION", it has name, TTL in seconds, IN (class or internet), A (record type), IP. | ||
=== Specify an exact DNS to search === | |||
<syntaxhighlight lang="bash"> | |||
$ dig @8.8.8.8 amazon.com | |||
</syntaxhighlight> | |||
[[Category:Commands]] | [[Category:Commands]] |
Revision as of 16:40, 16 May 2025
Install dig package
Dig is part of package bind9-dnsutils.
$ apt-file list bind9-dnsutils
bind9-dnsutils: /usr/bin/delv
bind9-dnsutils: /usr/bin/dig
bind9-dnsutils: /usr/bin/dnstap-read
bind9-dnsutils: /usr/bin/mdig
bind9-dnsutils: /usr/bin/nslookup
bind9-dnsutils: /usr/bin/nsupdate
bind9-dnsutils: /usr/share/doc/bind9-dnsutils/changelog.Debian.gz
bind9-dnsutils: /usr/share/doc/bind9-dnsutils/copyright
bind9-dnsutils: /usr/share/man/man1/delv.1.gz
bind9-dnsutils: /usr/share/man/man1/dig.1.gz
bind9-dnsutils: /usr/share/man/man1/dnstap-read.1.gz
bind9-dnsutils: /usr/share/man/man1/mdig.1.gz
bind9-dnsutils: /usr/share/man/man1/nslookup.1.gz
bind9-dnsutils: /usr/share/man/man1/nsupdate.1.gz
$ apt install bind9-dnsutils
Reverse lookup
This option sets simplified reverse lookups, for mapping addresses to names.
$ dig -x 54.239.28.85
Check dig version
$ dig -v
Find the ip of a host
$ dig amazon.com | grep -A 1 --color 'ANSWER SECTION'
;; ANSWER SECTION:
amazon.com. 842 IN A 205.251.242.103
Look at the "ANSWER SECTION", it has name, TTL in seconds, IN (class or internet), A (record type), IP.
Specify an exact DNS to search
$ dig @8.8.8.8 amazon.com