Bug 550 - Support +short flag in drill for easier inclusion of results in scripts
Support +short flag in drill for easier inclusion of results in scripts
Status: ASSIGNED
Product: ldns
Classification: Unclassified
Component: drill/tools
unspecified
Other All
: P5 enhancement
Assigned To: LDNS dev team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-04 13:51 CET by nlnetlabs.nl
Modified: 2016-10-18 13:13 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nlnetlabs.nl 2014-02-04 13:51:16 CET
Drill is a great dig alternative; it would be even better if it would support +short like dig does. 

Examples of output:

$ dig +short google.com
173.194.65.139
173.194.65.100
173.194.65.101
173.194.65.102
173.194.65.113
173.194.65.138

$ dig +short -x 8.8.8.8
google-public-dns-a.google.com.

$ dig +short mx google.com
50 alt4.aspmx.l.google.com.
10 aspmx.l.google.com.
20 alt1.aspmx.l.google.com.
30 alt2.aspmx.l.google.com.
40 alt3.aspmx.l.google.com.
Comment 1 skinner+netlabs 2014-06-27 17:06:09 CEST
drill could do with something like dig's '+short' option for scripting purposes, but also '+veryshort' to also resolve CNAMES:

$ drill gateway.internal
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 38329
;; flags: qr rd ra ; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;; gateway.internal.    IN      A

;; ANSWER SECTION:
gateway.internal.       527458  IN      CNAME   teak.internal.
teak.internal.  527384  IN      A       192.168.168.10

;; AUTHORITY SECTION:
internal.       527384  IN      NS      teak.internal.
internal.       527384  IN      NS      palm.internal.

;; ADDITIONAL SECTION:
palm.internal.  529025  IN      A       192.168.168.5

;; Query time: 2 msec
;; SERVER: 127.0.0.1
;; WHEN: Fri Jun 27 13:01:20 2014
;; MSG SIZE  rcvd: 118


$ dig +short gateway.internal
teak.internal.
192.168.168.10

$ host gateway.internal
gateway.internal is an alias for teak.internal.
teak.internal has address 192.168.168.10

$ host gateway.internal | awk '/ address / { print $4 }'
192.168.168.10
Comment 2 Willem Toorop 2016-10-18 13:13:32 CEST
That would be nice.
I will look into it after the bugfix release.