Jump to Navigation

094 - DNS & dig

DNS is an Internet service that translates domain names into IP addresses. Each time you use a domain name,
DNS translates the name into the corresponding IP address. In order to do the translation DNS holds records
for each domain. The most important are the A, CNAME, and MX records. The A record stores the host IP address.
The CNAME is an alias record, which is used to give multiple aliases to a single computer. The MX record is the mail
exchange record, which tells mail servers how to route email for this domain.

To query DNS and see the records it holds, you can use a software tool called dig that queries DNS servers directly.
Dig comes standard with all the major Linux distributions, and is useful for verifying and troubleshooting DNS problems.

To check the record for your domain, run dig with your domain name as the parameter. For example:

# dig -t [MX] [NS] www.google.com
; <<>> DiG 9.3.4-P1 <<>> www.google.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43305
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com.                        IN      A

;; ANSWER SECTION:
www.google.com.         85078   IN      CNAME   www.l.google.com.
www.l.google.com.       74      IN      A       74.125.155.147
www.l.google.com.       74      IN      A       74.125.155.104
www.l.google.com.       74      IN      A       74.125.155.99
www.l.google.com.       74      IN      A       74.125.155.103

;; Query time: 3 msec
;; SERVER: 192.168.10.6#53(192.168.10.6)
;; WHEN: Wed Jul  1 14:05:21 2009
;; MSG SIZE  rcvd: 116

 

Linux:


Main menu 2

Story | by Dr. Radut