-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdig.txt
25 lines (18 loc) · 1.07 KB
/
dig.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# the TTL is in \e[38;5;227;1mseconds\e[0m
# get dns info on domain, BUT it will show information from /etc/hosts as if it were legit
$ dig foo.bar
# so, use specific nameserver for things you've hardwired
$ dig @8.8.8.8 foo.bar
# Note that even this address has multiple servers/caches and can return different values for the same domain on
# subsequent queries.
# if the status at the top says NXDOMAIN, it means it couldn't find an IP address for it.
TTL = 0?
# if you see 0 where you expect a number, check for ";; WARNING: recursion requested but not available"
# this means the DNS server was not able to "recurse" to other DNS servers, and only had this IP address in its cache
# run it again with @8.8.8.8 for example
# It might also return an AUTHORITY SECTION instead of an ANSWER SECTION which contains the dns server you should ask
# instead. Sometimes nested subdomains are handled by a different DNS server.
# get ALL THE INFO
$ dig foo.bar ANY
# get only the ip address (or, like, emptiness for not found). It will also return a CNAME if there is one.
$ dig +short foo.bar