Queri is a simple yet powerful command-line DNS resolver built with Rust. It's designed to perform both iterative and recursive DNS lookups, providing you with detailed information about domain names. Queri supports various DNS record types, making it a versatile tool for network analysis and DNS exploration.
- Recursive DNS Resolution: Recursively queries nameservers to find the IP addresses for domain names.
- Iterative Lookup Support: Also supports iterative lookups for nameservers when needed.
- Support for A, AAAA, MX, NS, CNAME, SRV, and TXT Records: Provides results for all essential record types.
- Dynamic Byte Packet Buffer: Efficiently handles DNS message parsing and construction.
Queri's backend, upon receiving a query either from the server or the user, first uses a UDP socket to interact with DNS protocols, encoding the query into a binary DNS message. It then recursively queries nameservers, parsing each response by decoding the binary data to follow CNAME and NS records to reach an A, AAAA, MX, NS, CNAME, SRV, or TXT record, caching resolved results to improve efficiency and finally format the DNS responses to send to the user or client.
- Rust: You need to have the Rust toolchain installed. If you don't, visit rustup.rs for installation instructions.
-
Clone the repository:
$ git clone https://github.com/JeninSutradhar/Queri $ cd Queri
-
Build the project:
$ cargo build --release
This command compiles the project and creates the executable in the
target/release
folder.
-
Run the executable:
$ cargo run
This will start Queri in interactive mode by default. You'll see a prompt asking for the domain and query type.
Enter domain to resolve:
and then for
Enter query type (A, AAAA, MX, NS, CNAME, SRV, TXT, ALL):
If any incoming query is received then Queri will act as a DNS server first.
$ Enter domain to resolve: www.yahoo.com
Enter query type (A, AAAA, MX, NS, CNAME, SRV, TXT, ALL): ALL
Attempting to resolve www.yahoo.com with type ALL
========================= DNS Resolution Results =========================
Query Type | Response Code | Record | TTL
--------------------------------------------------------------------
A | NOERROR | www.yahoo.com - me-ycpi-cf-www.g06.yahoodns.net | 60
MX | NOERROR | www.yahoo.com - me-ycpi-cf-www.g06.yahoodns.net | 60
NS | NOERROR | www.yahoo.com - me-ycpi-cf-www.g06.yahoodns.net | 60
CNAME | NOERROR | www.yahoo.com - me-ycpi-cf-www.g06.yahoodns.net | 60
SRV | NOERROR | www.yahoo.com - me-ycpi-cf-www.g06.yahoodns.net | 60
TXT | NOERROR | www.yahoo.com - me-ycpi-cf-www.g06.yahoodns.net | 60
========================= Resolution Complete =========================
Do you want to resolve another domain? (y/n):
You can send direct queries to Queri as a DNS server:
- Start the Queri app by running
./target/release/queri
. This will make Queri act as a DNS server on port8080
. - In a new terminal window use
dig
with@127.0.0.1
to query Queri like:dig @127.0.0.1 -p 8080 google.com A
[dependencies]
colored = "2.0"
Queri is licensed under the MIT License. See the LICENSE file for more information.
Contributions are always welcome! Feel free to submit issues or pull requests for bugs, features, and improvements.