NAME
App::dnsq - A full-featured dig-like DNS query tool
VERSION
Version 1.1.0
SYNOPSIS
# Command line usage
dnsq google.com
dnsq --json --short example.com
dnsq --batch queries.txt
dnsq --interactive
# Programmatic usage
use DNSQuery::Resolver;
use DNSQuery::Output;
my %config = (
server => '8.8.8.8',
timeout => 5,
retries => 3,
protocol => 'udp',
);
my $resolver = DNSQuery::Resolver->new(\%config);
my $result = $resolver->query('google.com', 'A');
DESCRIPTION
App::dnsq is a full-featured DNS query tool written in Perl, providing a modern alternative to dig with additional features like JSON output, smart caching, batch processing, and interactive mode.
FEATURES
Multiple output formats (full dig-like, short, JSON)
TCP and UDP protocol support
Custom DNS server with configurable port
Configurable timeout and retry settings with exponential backoff
Batch mode with parallel processing support
Trace mode to follow DNS delegation path
Interactive shell with statistics
DNSSEC support
Smart caching with TTL awareness and optional disk persistence
Comprehensive input validation
Progress indicators for batch operations
INSTALLATION
cpan App::dnsq
Or manually:
perl Makefile.PL
make
make test
make install
COMMAND LINE OPTIONS
- -s, --server <ip>
-
DNS server to query
- -p, --port <port>
-
DNS server port (default: 53)
- -t, --timeout <sec>
-
Query timeout in seconds (default: 5)
- -r, --retries <num>
-
Number of retries (default: 3)
- -T, --tcp
-
Use TCP protocol
- -U, --udp
-
Use UDP protocol (default)
- -j, --json
-
Output in JSON format
- -S, --short
-
Short output (answers only)
- --trace
-
Trace DNS delegation path
- -b, --batch <file>
-
Batch mode - process queries from file
- -i, --interactive
-
Interactive mode
- -d, --dnssec
-
Request DNSSEC records
- -v, --verbose
-
Verbose output
- -Q, --quiet
-
Quiet mode (no banners)
- -h, --help
-
Show help message
- -V, --version
-
Show version
EXAMPLES
# Basic query
dnsq google.com
# Query specific record type
dnsq google.com MX
# Use custom DNS server
dnsq -s 8.8.8.8 example.com
# JSON output
dnsq --json google.com
# Short output (answers only)
dnsq --short google.com
# Use TCP
dnsq --tcp google.com
# Trace DNS delegation
dnsq --trace example.com
# Batch mode
dnsq --batch queries.txt
# Interactive mode
dnsq --interactive
MODULES
DNSQuery::Resolver
Core DNS resolution with caching and statistics.
DNSQuery::Validator
Input validation for domains, IPs, and query parameters.
DNSQuery::Cache
Smart caching with TTL support and optional persistence.
DNSQuery::Constants
Shared constants for query types and limits.
DNSQuery::Output
Output formatting (full, short, JSON).
DNSQuery::Batch
Batch processing with parallel support.
DNSQuery::Interactive
Interactive shell mode.
DEPENDENCIES
Net::DNS >= 1.0
JSON >= 2.0
Time::HiRes
Term::ReadLine
Storable
File::Spec
Optional Dependencies
Parallel::ForkManager >= 2.0 (for parallel batch processing)
REPOSITORY
https://github.com/bl4ckstack/dnsq
BUGS
Please report bugs at https://github.com/bl4ckstack/dnsq/issues
AUTHOR
Isaac Caldwell
LICENSE
MIT License
Copyright (c) 2025 Isaac Caldwell
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.