How To Run Dig Command In Windows
Windows
Intro
Dig is a really useful networking tool. I apply it several times a day. Just e'er on Linux where it's unremarkably built-in. On Raspberry Pi's raspbian you can install it with a simple apt-go install dnsutils. Then I learned it wasn't hard at all to install on Windows, especially as a fairly minimalist installation that just puts files on your PC and makes no changes to the Registry, which is all you really need for light utilise.
The details
Go to http://www.isc.org/downloads/. Expand Bind.
Click download button for the current stable release.
Pick the win-64-bit link (because chances are you're running Windows 64 bit these days) and wait for download to complete.
Open up zip file.
Unzip or excerpt all files to (this is my proffer) c:\apps\demark.
To run it
Open a command window. Probably easiest manner is hold down Windows central + r and blazon in cmd. In CMD window just blazon \apps\demark\dig to run dig like you practise on Linux.
Instance commands
Example i, Resolve accost for google.com
C:\> \apps\bind\dns google.com
; <<>> DiG 9.ix.eight-P2 <<>> google.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, condition: NOERROR, id: 24929 ;; flags: qr rd ra; QUERY: ane, ANSWER: six, Authorization: 0, Boosted: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;google.com. IN A ;; ANSWER Section: google.com. 88 IN A 173.194.207.113 google.com. 88 IN A 173.194.207.139 google.com. 88 IN A 173.194.207.138 google.com. 88 IN A 173.194.207.101 google.com. 88 IN A 173.194.207.102 google.com. 88 IN A 173.194.207.100 ;; Query time: 41 msec ;; SERVER: 192.168.ii.ane#53(192.168.2.1) ;; WHEN: Mon Jan xi 12:16:17 Eastern Standard Time 2016 ;; MSG SIZE rcvd: 135
; <<>> DiG ix.9.8-P2 <<>> google.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, condition: NOERROR, id: 24929 ;; flags: qr rd ra; QUERY: i, Respond: 6, Authorization: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION Section: ;google.com. IN A ;; ANSWER SECTION: google.com. 88 IN A 173.194.207.113 google.com. 88 IN A 173.194.207.139 google.com. 88 IN A 173.194.207.138 google.com. 88 IN A 173.194.207.101 google.com. 88 IN A 173.194.207.102 google.com. 88 IN A 173.194.207.100 ;; Query time: 41 msec ;; SERVER: 192.168.ii.1#53(192.168.2.1) ;; WHEN: Mon Jan xi 12:16:17 Eastern Standard Time 2016 ;; MSG SIZE rcvd: 135
This gives all kinds of useful information – what your default DNS server is (at the bottom – mine is 192.168.2.one), how long the query took *this one: 41 msec), whether the answer is authoritative or non (no AA flag here, so this is not an administrative reply), too as the answer to the question posed.
Example ii, Resolve nameserver records for the domain amazon.com using Google'due south DNS server eight.8.8.8 over TCP from our local IP address of 192.168.2.3
We started out boring, but this case throws the kitchen sink at you to show the power of dig!
C:\> \apps\bind\dig +tcp -b 192.168.2.3 ns amazon.com @8.8.eight.8
; <<>> DiG 9.9.8-P2 <<>> +tcp -b 192.168.2.3 ns amazon.com @viii.viii.eight.8 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64444 ;; flags: qr rd ra; QUERY: 1, Respond: six, AUTHORITY: 0, ADDITIONAL: ane ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION Department: ;amazon.com. IN NS ;; Respond Department: amazon.com. 3599 IN NS ns3.p31.dynect.net. amazon.com. 3599 IN NS ns4.p31.dynect.internet. amazon.com. 3599 IN NS ns1.p31.dynect.internet. amazon.com. 3599 IN NS pdns1.ultradns.net. amazon.com. 3599 IN NS pdns6.ultradns.co.uk. amazon.com. 3599 IN NS ns2.p31.dynect.net. ;; Query time: 50 msec ;; SERVER: eight.viii.8.viii#53(eight.8.8.8) ;; WHEN: Mon Jan 11 12:27:26 Eastern Standard Time 2016 ;; MSG SIZE rcvd: 188
; <<>> DiG ix.nine.8-P2 <<>> +tcp -b 192.168.2.3 ns amazon.com @8.8.viii.8 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64444 ;; flags: qr rd ra; QUERY: 1, ANSWER: 6, Authorization: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION Department: ;amazon.com. IN NS ;; Answer SECTION: amazon.com. 3599 IN NS ns3.p31.dynect.net. amazon.com. 3599 IN NS ns4.p31.dynect.net. amazon.com. 3599 IN NS ns1.p31.dynect.net. amazon.com. 3599 IN NS pdns1.ultradns.net. amazon.com. 3599 IN NS pdns6.ultradns.co.u.k.. amazon.com. 3599 IN NS ns2.p31.dynect.cyberspace. ;; Query fourth dimension: 50 msec ;; SERVER: 8.viii.8.8#53(eight.viii.8.viii) ;; WHEN: Monday Jan xi 12:27:26 Eastern Standard Time 2016 ;; MSG SIZE rcvd: 188
The only problem is that I don't call back the TCP option actually worked – I gotta run wireshark to verify. On Linux information technology definitely works! Non sure what's incorrect with windows. But the other options are working as designed.
OK, wireshark install is failing, only I ran tcpdump on a DNS server I run and confirmed that indeed the +tcp option is working forcing dig to utilize TCP communication for those queries.
Raspberry Pi
I believe you practice
$ sudo apt-get install bind9-dnsutils
At least on a generic Debian arrangement that works. I have to confirm on RPi however.
Conclusion
We've demonstrated a low-impact way to install dig for Windows and shown some examples of using information technology.
References and related
Electric current Bind link from ISC: https://downloads.isc.org/isc/bind9/ix.16.eight/BIND9.16.viii.x64.zip
Or…you get get dig through a Cygwin installation. I've written about Cygwin here: Cygwin. Or only go to cygwin.com.
Source: https://drjohnstechtalk.com/blog/2016/01/dig-for-windows/
Posted by: bryantbouring.blogspot.com
0 Response to "How To Run Dig Command In Windows"
Post a Comment