dig/nslookup команды (работа с dns)

nslookup redhat.com
nslookup -query=mx redhat.com
nslookup -type=ns redhat.com
nslookup -type=soa redhat.com
nslookup -type=any google.com
nslookup 209.132.183.181
nslookup redhat.com ns1.redhat.com
nslookup -port 56 redhat.com
nslookup -timeout=10 redhat.com
nslookup -debug redhat.com

------------------------------
The dig command output has the following sections:
  • Header: This displays the dig command version number, the global options used by the dig command, and few additional header information.
  • QUESTION SECTION: This displays the question it asked the DNS. i.e This is your input. Since we said ‘dig redhat.com’, and the default type dig command uses is A record, it indicates in this section that we asked for the A record of the redhat.com website
  • ANSWER SECTION: This displays the answer it receives from the DNS. i.e This is your output. This displays the A record of redhat.com
  • AUTHORITY SECTION: This displays the DNS name server that has the authority to respond to this query. Basically this displays available name servers of redhat.com
  • ADDITIONAL SECTION: This displays the ip address of the name servers listed in the AUTHORITY SECTION.
  • Stats section at the bottom displays few dig command statistics including how much time it took to execute this query

  • +nocomments – Turn off the comment lines
  • +noauthority – Turn off the authority section
  • +noadditional – Turn off the additional section
  • +nostats – Turn off the stats section
  • +noanswer – Turn off the answer section (Of course, you wouldn’t want to turn off the answer section)

dig redhat.com
dig redhat.com +nocomments +noquestion +noauthority +noadditional +nostats
dig redhat.com +noall +answer
dig redhat.com  MX +noall +answer
dig -t MX redhat.com +noall +answer
dig redhat.com NS +noall +answer
dig -t NS redhat.com +noall +answer
dig redhat.com ANY +noall +answer
dig -t ANY redhat.com  +noall +answer
dig redhat.com +short
dig redhat.com ns +short
dig -x 209.132.183.81 +short
dig -x 209.132.183.81
dig @ns1.redhat.com redhat.com

vi names.txt
dig -f names.txt +noall +answer
dig -f names.txt MX +noall +answer
dig redhat.com mx +noall +answer centos.org ns +noall +answer

--------------

freebsd 10 по умолчанию не имеет nslookup, dig. искать в
/usr/ports/dns/bind-tools