Domain Analyzer is a Python script developed to probe domain details using a variety of common tools like whois, dig, host, and nslookup. The results from each tool are captured and stored in a file named fetchDom.txt. For users on Linux or macOS, the script will also attempt to open the results file using the system's default text viewer.
- Overview
- Features
- Prerequisites
- Usage
- Script Workflow
- Output
- Compatibility
- Notes
- Contribution
- Author
The Domain Analyzer script provides a convenient way to gather detailed information about a domain using various command-line tools. Whether you are troubleshooting, performing reconnaissance, or verifying DNS records, this script simplifies the process by consolidating outputs into a single file.
-
Tool Presence Verification:
- Checks for the availability of whois, dig, host, and nslookup on the system.
-
Domain Information Gathering:
- Executes the specified tools to retrieve domain-related information.
-
Output Management:
- Saves results in a structured format in the fetchDom.txt file.
-
Auto-Opening Results:
- For Linux or macOS users, automatically opens the results file in the system's default text editor.
Ensure the following requirements are met before running the script:
-
Python 3.x installed on your system.
-
Tools required for the script:
- whois
- dig
- host
- nslookup
-
All tools must be accessible through the system's PATH.
- Prepare the script:
-
Save the script as domain_analyzer.py.
-
Ensure it has execute permissions if needed:
chmod +x domain_analyzer.py
- Run the script:
-
Execute the script from the terminal:
python domain_analyzer.py
1.Input domain:
- Enter the domain name when prompted (e.g., example.com).
- Review results:
-
Check the output in the fetchDom.txt file.
-
On Linux/macOS, the results will automatically open in your text viewer if available.
- Check Dependencies:
- Verifies that required tools (whois, dig, host, nslookup) are installed.
- Prompt for Input:
- Requests the user to input a domain name.
- Execute Commands:
- Runs each tool against the provided domain and captures the output.
- Save Results:
- Outputs the aggregated results to fetchDom.txt.
- Auto-Open Results (Linux/macOS only):
- Attempts to open the results in the system's default text editor.
-
Results are saved in fetchDom.txt.
-
Example output:
WHOIS Data: <whois data here> DIG Data: <dig output here> HOST Data: <host output here> NSLOOKUP Data: <nslookup output here> -
Any missing or incomplete data will be clearly noted.
-
Operating Systems:
- Linux
- macOS
- Windows (limited functionality; does not support auto-opening results).
-
Error Handling:
- The script exits with an error message if:
- A required tool is missing.
- The provided domain name is invalid.
- An unexpected error occurs during execution.
- The script exits with an error message if:
-
Overwrite Warning:
- The fetchDom.txt file is overwritten each time the script runs. Back up the file if needed.
-
Tool Installation:
- Ensure required tools are installed. For example:
-
On Ubuntu/Debian:
sudo apt install whois dnsutils
-
On macOS:
Use brew install.
-
- Ensure required tools are installed. For example:
-
Customization:
- Modify the script to adjust the file path or add additional tools/commands as needed.
Your contributions can make these scripts even better:
-
Fork the repository.
-
Create a new branch:
git checkout -b my-awesome-feature
-
Make your invaluable changes.
-
Commit your changes:
git commit -am 'Added some amazing features' -
Push to the branch:
git push origin my-awesome-feature
-
Create a new Pull Request targeting the Python directory.
Contributions are welcome! Feel free to open issues, suggest enhancements, or submit pull requests to improve the script.
- Raphael Chookagian
- 12/07/2024
-
This script is provided as-is without any warranties. Users are advised to review and understand the script before executing it.
-
This project is licensed under the MIT License. See the LICENSE file for details.