Install dnsx on Ubuntu 24.04

Install dnsx on Ubuntu 24.04

The dnsx is an open-source command line tool that is primarily used for DNS enumeration. It supports multiple DNS queries, user supplied resolvers, DNS wildcard filtering, and more. This tool can be useful for security professionals and ethical hackers. This tutorial explains how to install dnsx on Ubuntu 24.04.

Install dnsx

Retrieve the latest version of dnsx from the GitHub repository and assign it to a variable:

DNSX_VERSION=$(curl -s "https://api.github.com/repos/projectdiscovery/dnsx/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Download archive file using previously determined version:

wget -qO dnsx.zip https://github.com/projectdiscovery/dnsx/releases/latest/download/dnsx_${DNSX_VERSION}_linux_amd64.zip

Extract the executable to /usr/local/bin directory:

sudo unzip -q dnsx.zip -d /usr/local/bin dnsx

Ensure the installation is successful by verifying the dnsx version:

dnsx --version

Delete the archive file as it's no longer needed:

rm -rf dnsx.zip

Testing dnsx

The dnsx command can retrieve various DNS records. For instance, the following command fetches A, AAAA, MX, and NS records for a specified domain:

echo google.com | dnsx -silent -resp -a -aaaa -mx -ns

Output example:

google.com [A] [172.217.16.46]
google.com [AAAA] [2a00:1450:400f:80b::200e]
google.com [MX] [smtp.google.com]
google.com [NS] [ns4.google.com]
google.com [NS] [ns2.google.com]
google.com [NS] [ns1.google.com]
google.com [NS] [ns3.google.com]

Uninstall dnsx

Uninstall dnsx by removing the executable file:

sudo rm -rf /usr/local/bin/dnsx

You can additionally delete the dnsx configuration directory:

rm -rf ~/.config/dnsx

Leave a Comment

Cancel reply

Your email address will not be published.