-
Notifications
You must be signed in to change notification settings - Fork 63
Install Dig & WSL
BIND9 dig(domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried. It is useful for network troubleshooting and for educational purposes. Other lookup tools tend to have less functionality.
BIND9 version 9.16.x and its tools is the last branch of development with native support for Windows
- Extract the downloaded file and install BIND in the following directory:
C:\Program Files\ISC BIND 9
. Select theTools Only check box
. - Once BIND is installed, open
Control Panel
, and then openSystem
. - Open
advanced system settings
from right tab, clickEnvironment Variables
. - Under
System Variables
, select Path, and then click Edit. - At the end of the path in the Edit System Variable window, add
C:\Program Files\ISC BIND 9\bin
, and then click OK. - In the Edit Variables window, click OK. In the System properties window, click OK.
- Open new terminal window and run
dig -v
to check version and confirm its installed.
Use Windows Subsystem for Linux(WSL) to get the latest versions of dig from dnsutils package or build BIND9
Note
Using WSL 2 which is only available in Windows 11 or Windows 10(Version 1903, Build 18362 or later). Use WSL 1 for older builds.
- Download the latest package:
x64 based PC - https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
arm64 based PC - https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_arm64.msi
Tip
If you're not sure what kind of machine you have, open Command Prompt or PowerShell and enter:
systeminfo | find "System Type"
- Open PowerShell as administrator and enable
Virtual Machine Platform
&Windows Subsystem for Linux
:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Restart your machine to complete the installation and then select
WSL version 2
using PowerShell as administrator:
wsl --set-default-version 2
-
Install a Linux distribution from Microsoft Store app or if store is not available, you can download files manually from https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions or use command line to install Linux distributions .
To get a list of all available distros:
wsl -l -o
Install Distro:
wsl --install -d YourDistroName
Once the distribution has been downloaded, navigate to the folder containing the download and run the following command in that directory (right click in folder, select "open Powershell here"), where app-name is the name of the Linux distribution .appx or .appxBundle file.
Add-AppxPackage .\app_name.appx
Once the process of installing your Linux distribution with WSL is complete (it will be installed to Windows Apps), open the distribution using the start menu search.
You will be asked to create a username and password for your Linux distribution. Once finish it can be started in PowerShell using wsl
command and check dig version using dig -v
.
If dig not installed, run:
sudo apt install dnsutils
For Android install termux from its repo(PlayStore version is outdated)
Upgrade packages:
pkg upgrade
Install dig:
pkg install dnsutils
To query domain “A” record
dig google.com
Query specific name server
dig google.com @8.8.8.8
Specify port number
dig @8.8.8.8 -p 53 google.com
Using IPv4 & IPv6
By default dig queries are running over the IPv4 network, we can specify to use the IPv4 with the “-4” option, or alternatively to use the IPv6 with the “-6” option.
dig -4 @8.8.8.8 google.com
dig -6 @2001:4860:4860::8888 google.com
Localhost
dig @127.0.0.1 google.com
dig @fe80::1 google.com