|
dig [@server] [-b address] [-c class] [-f filename] [-k filename] [-m] [-p port#] [-q name] [-t type] [-x addr] [-y [hmac:]name:key] [-4] [-6] [name] [type] [class] [queryopt...]
|
|
Tired of always typing the same options ? Create a Run Control file for dig.
|
vi $HOME/.digrc |
|
List address records
|
dig -t A tme520.net |
|
List aliases
|
dig -t CNAME tme520.net |
|
Find who manages a domain
|
dig -t SOA tme520.net |
|
List mail servers
|
dig tme520.net MX |
|
List name servers
|
dig tme520.net NS |
|
List any type of Resource Record
|
dig tme520.net ANY |
|
HEADER
|
Displays the dig command version, the global options used, the type of operation (opcode), the status of the operation (NOERROR) and the message id (necessary to match responses to queries).
|
|
QUESTION
|
This is your input, the question that has been asked to the DNS.
|
|
ANSWER
|
The 2nd field is the time in seconds that the record may be cached (0 = don't cache), the 3rd field is the class (Internet (IN), Chaos (CH), Hesiod (HS)...), the 4th is the type (A, NS, CNAME, MX...) and the 5th, the IP.
|
|
AUTHORITY
|
This section contains the DNS name server that has the authority to answer your query (type: NS, Name Server).
|
|
ADDITIONAL
|
The additional section carries Resource Records related to the RRs from the other sections.
|
|
STATISTICS
|
Displays the time it took to get an answer, the IP of the DNS server used, the date and size of the message.
|
|
Using a list
|
dig -f names.list |
|
Using several arguments
|
dig centos.org MX +noall +answer suckless.org ANY +short |
$ cat names.listredhat.comubuntu.comperdu.com
|
Display only the ANSWER section
|
dig opensuse.org +noall +answer |
|
Activate the short output
|
dig perdu.com +short |
|
Reverse DNS (get name from IP)
|
dig -x 208.97.177.124 |
|
Use a specific DNS server
|
dig @8.8.4.4 redhat.com |
|
Display the name resolution path
|
dig google.com +trace |
|
Request a zone transfer
|
dig microsoft.com AXFR |
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.