nstree is a powerful DNS Resolution Tool that allows you to perform comprehensive DNS queries for multiple domains. It supports various DNS record types and can visualize the DNS resolution hierarchy using Graphviz diagrams. Whether you're troubleshooting DNS issues, analyzing domain configurations, or simply exploring DNS records, nstree
provides an efficient and user-friendly solution.
- Asynchronous DNS Resolution: Quickly resolve multiple domains concurrently.
- Support for Multiple DNS Record Types: Query A, MX, CNAME, NS, TXT, AAAA, SOA, PTR, and SRV records.
- Custom DNS Resolvers: Specify custom DNS resolver IPs for your queries.
- Graphviz Integration: Export DNS resolution results as Graphviz
.gv
and.pdf
diagrams. - Error Logging: Comprehensive error logging for troubleshooting.
- GPLv3 Licensed: Open-source under the GNU General Public License v3.
- Python 3.7+ must be installed on your system.
- Graphviz must be installed and added to your system's PATH.
nstree can be installed as a system tool using the provided setup script. Run the following commands:
curl -O https://raw.githubusercontent.com/atenreiro/nstree/main/setup.sh
chmod +x setup.sh
sudo ./setup.sh
This will install nstree
and make it accessible as a system command.
git clone https://github.com/atenreiro/nstree.git
cd nstree
It's recommended to use a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Note: Ensure that dnspython
and graphviz
are listed in your requirements.txt
.
python3 nstree.py [OPTIONS] DOMAIN [DOMAIN ...]
DOMAIN
: One or more domains to resolve.
-
-t, --record-types
: Specify DNS record types to query. Supported types:A
,MX
,CNAME
,NS
,TXT
,AAAA
,SOA
,PTR
,SRV
- Default:
A
-
-r, --resolver
: Specify a custom DNS resolver IP (e.g.,8.8.8.8
). -
--export
: Export the DNS resolution results as Graphviz diagrams (.gv
and.pdf
files). -
-v, --version
: Show the tool's version and exit.
-
Basic DNS A Record Query:
python3 nstree.py example.com
-
Query Multiple Domains with Specific Record Types:
python3 nstree.py example.com opensquat.com -t A MX CNAME
-
Use a Custom DNS Resolver and Export Results:
python3 nstree.py example.com -r 8.8.8.8 --export
-
Query Multiple Domains with All Supported Record Types:
python3 nstree.py example.com opensquat.com -t A MX CNAME NS TXT AAAA SOA PTR SRV
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Andre Tenreiro.
For any questions, please feel free to reach out or open an issue on the GitHub repository.