Editing
Dig
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples == === <span id="ex-a"></span>Query A Record === <syntaxhighlight lang="bash"> # Query IPv4 address record dig A example.com # Output: example.com. 300 IN A 93.184.216.34 </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-aaaa"></span>Query AAAA Record === <syntaxhighlight lang="bash"> # Query IPv6 address record dig AAAA example.com # Output: example.com. 300 IN AAAA 2606:2800:220:1:248:1893:25c8:1946 </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-mx"></span>Query MX Records === <syntaxhighlight lang="bash"> # Query mail exchange records dig MX example.com # Output: example.com. 300 IN MX 10 mail.example.com. </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-ns"></span>Query Name Servers === <syntaxhighlight lang="bash"> # Query authoritative name servers dig NS example.com # Output: example.com. 300 IN NS b.iana-servers.net. example.com. 300 IN NS a.iana-servers.net. </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-cname"></span>Query CNAME Record === <syntaxhighlight lang="bash"> # Query canonical name (alias) record dig CNAME www.example.com # Output: www.example.com. 300 IN CNAME example.com. </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-soa"></span>Query SOA Record === <syntaxhighlight lang="bash"> # Query Start of Authority record dig SOA example.com # Output: example.com. 300 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2017042745 7200 3600 1209600 3600 </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-txt"></span>Query TXT Records === <syntaxhighlight lang="bash"> # Query text records dig TXT example.com # Output: example.com. 300 IN TXT "v=spf1 -all" </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-@"></span>Use Specific DNS Server === <syntaxhighlight lang="bash"> # Query A record using Google's DNS server dig @8.8.8.8 A example.com # Output: example.com. 300 IN A 93.184.216.34 </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-short"></span>Simplified Output === <syntaxhighlight lang="bash"> # Return only the IP address dig +short A example.com # Output: 93.184.216.34 </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-noall"></span>Show Only Answer Section === <syntaxhighlight lang="bash"> # Suppress all sections except the answer dig +noall +answer A example.com # Output: example.com. 300 IN A 93.184.216.34 </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-timeout"></span>Set Timeout === <syntaxhighlight lang="bash"> # Set DNS query timeout to 2 seconds dig +timeout=2 A example.com # Output: example.com. 300 IN A 93.184.216.34 </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-retries"></span>Set Number of Retries === <syntaxhighlight lang="bash"> # Limit query retries to 1 attempt dig +tries=1 A example.com # Output: example.com. 300 IN A 93.184.216.34 </syntaxhighlight> ''[[#options|↑ Options]]'' === <span id="ex-tcp"></span>Force TCP Query === <syntaxhighlight lang="bash"> # Force DNS query over TCP dig +tcp A example.com # Output: example.com. 300 IN A 93.184.216.34 </syntaxhighlight> ''[[#options|↑ Options]]''
Summary:
Please note that all contributions to HackOps may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
HackOps:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Tools
What links here
Related changes
Special pages
Page information