Dig, without the cruft


/ Published in: Bash
Save to your folder(s)

If you pass the +short option to dig, it will give you a really short and sweet answer - just the IP address.

$ dig fosswire.com +short
208.113.149.33


Copy this code and paste it in your HTML
  1. $ dig fosswire.com +short
  2.  
  3. 208.113.149.33
  4.  
  5.  
  6.  
  7. $ dig fosswire.com
  8.  
  9. ; <<>> DiG 9.4.1-P1 <<>> fosswire
  10. ;; global options: printcmd
  11. ;; Got answer:
  12. ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27325
  13. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
  14.  
  15. ;; QUESTION SECTION:
  16. ;fosswire. IN A
  17.  
  18. ;; Query time: 86 msec
  19. ;; SERVER: 10.0.1.1#53(10.0.1.1)
  20. ;; WHEN: Tue Apr 29 01:03:13 2008
  21. ;; MSG SIZE rcvd: 26

URL: http://fosswire.com/tag/cli/page/18/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.