dig Linux Commands
What is Linux dig Command?
Explanation
dig COMMAND:dig (Domain Information Groper) command is used in network administration. It is used to querying and display the server details of Domain Name System (DNS) name servers. dig is used for network trouble shooting.
SYNTAX :
dig [ @server ] [ -b address ] [ -c class ] [ -f filename ] [ -k filename ] [ -p port# ] [ -t type ] [ -x addr ] [ -y name:key ] [ name ] [ type ] [ class ] [ queryopt... ]
dig [ -h ]
dig [ global-queryopt... ] [ query... ]
OPTIONS:
-b |
Set the source IP address of the query instead of Domain Name System (DNS) name servers. |
-c |
Over-ride the default query class (IN for internet). |
-f |
Operate in batch mode by reading a list of lookup requests to process from a file. |
-4 |
Force dig to only use IPv4 query transport. |
-6 |
Force dig to only use IPv6 query transport. |
-t |
Set the query type to type, any valid query type which is supported in BIND9. |
-h |
Print a brief summary of the command-line arguments and options. |
EXAMPLE:
-
dig hscripts.com
Output:
; <<>> DiG 9.7.4-P1-RedHat-9.7.4-2.P1.fc14 <<>> hscripts.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36393
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0
;; QUESTION SECTION:
;hscripts.com.
IN A
;; ANSWER SECTION:
hscripts.com. 10113 IN A 50.28.68.231
;; AUTHORITY SECTION:
hscripts.com. 66378 IN NS ns2.dnsforcloud.com.
hscripts.com. 66378 IN NS ns1.dnsforcloud.com.
;; Query time: 0 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Wed Jul 17 14:57:52 2013
;; MSG SIZE rcvd: 94
The above command lists the information about hscripts.com.