Breaking News
Loading...
Sunday, September 1, 2013

Linux Dig (Domain Information Groper) Command - DNS lookup utility

7:00 AM
1. Introduction

DIG  stands for domain information groper. DIG is a dns lookup utility in UNIX like operating System. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried. Most DNS administrators use dig command to troubleshoot DNS related problems because of its flexibility, ease of use and clarity of output. Dig command can operate in interactive command line mode or in batch mode by reading requests from an operating system file. dig by default uses /etc/resolv.conf and queries the name servers listed there.
2. Linux Dig Command
Example:1 Understand DIG command Output
Syntax 1 : # dig <Domain Name>
When we pass any domain to dig command it simply try to display A record (IP Address) Output of above dig command includes the followings sections:

HEADER : It shows the dig command version number and other  header information.

QUESTION SECTION :  It displays the what question has been asked , in my case “dig nextstep4it.com” means what is A record(ip address) of nextstep4it.com

ANSWER SECTION : It displays the answer of the questions being asked in question section , so it displays the A Record of nextstep4it.com

AUTHORITY SECTION: It displays which  DNS name server that has the authority to respond to this query. Basically this displays available name servers of domain.

Example :2 Query NS records of a Domain
Syntax 2 : # dig <Domain Name> -t <DNS Record>
Example:3 Query MX records of a domain
Syntax 3 : # dig  <Domain Name>  -t  MX
Example:4  Query SPF (Sender Policy Framework) Record of a Domain
Syntax 4 : # dig  <Domain Name> -t txt
Example:5 Reverse lookups using -x option i.e mapping addresses to names
Syntax 5 : # dig  -x  <ip-address> +short

Example:6  DNS lookup using specific DNS server.
Syntax 6 : # dig @<DNS Server> <Domain Name> -t <Type of DNS Record>
Example:7 Display Only ANSWER SECTION in Dig Command Output
Syntax 7 : # dig <Domain Name>  +nocomments +noquestion +noauthority +noadditional +nostats
Where :
  • +nocomments – Turn off the comment lines
  • +noauthority – Turn off the authority section
  • +noadditional – Turn off the additional section
  • +nostats – Turn off the stats section

Example:8  Multiple DNS Query using “dig -f” option
Syntax 8 : # dig -f <file name>  +noall +answer
create a file “bulkquery.txt” and mentioned the Domain Names , in my case I have used the below :

# vim  bulkquery.txt
google.com.vn
yahoo.com.vn
centos.org

Below Command will query MX records for the domains mentioned in “bulkquery.txt” file

1 comments:

  1. Voyance reponse oui non horoscope cancer travail 2012

    My website :: voyance par telephone gratuit (www.londonsuccessuniversity.com)

    ReplyDelete

 
Toggle Footer