dig show only answer

Posted by Zulakis on Server Fault See other posts from Server Fault or by Zulakis
Published on 2012-09-23T08:05:43Z Indexed on 2012/09/23 9:39 UTC
Read the original article Hit count: 275

Filed under:

I want dig only to show the answer of my query.

Normally, it prints out alot of additional info like this:

;; <<>> DiG 9.7.3 <<>> google.de
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55839
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.de.                     IN      A

;; ANSWER SECTION:
google.de.              208     IN      A       173.194.69.94

;; Query time: 0 msec
;; SERVER: 213.133.99.99#53(213.133.99.99)
;; WHEN: Sun Sep 23 10:02:34 2012
;; MSG SIZE  rcvd: 43

I want this to be reduced to just the answer section.

dig has alot of options, a good one i found was +noall +answer

; <<>> DiG 9.7.3 <<>> google.de +noall +answer
;; global options: +cmd
google.de.              145     IN      A       173.194.69.94

It leaves out most of the stuff, but still shows this options thing.

Any ideas on how to remove it using dig options? I sure could cut it out using other tools, but a option with dig itself would be the cleanest and nicest.

© Server Fault or respective owner

Related posts about dig