KissDNS
Keep It Simple, Stupid DNS for Developers
KissDNS is a lightweight DNS server built in Rust, designed for developers who don't have root rights or need to work in secure environments where traditional DNS configuration isn't available. Its focus is on simplicity and ease of use, allowing you to quickly spin up a local DNS server for development, testing, and secure domain resolution without requiring administrative privileges.
Features
-
No Root Required:
Run KissDNS as a non-privileged user, ideal for secure environments or restricted development setups. -
Simple & Minimalistic:
Keep it simple, stupid (KISS) – no extra frills, just a straightforward DNS server. -
Wildcard Resolution:
Supports wildcard domains (e.g.,*.test.demo) so you can resolve multiple subdomains with a single record. -
Caching:
Caches DNS responses for 60 seconds to reduce latency on repeated queries. -
Fallback DNS:
If a domain is not found in your local configuration, queries are forwarded to a fallback DNS server (e.g., Google’s 8.8.8.8). -
Dual Protocol Support:
Handles both UDP and TCP DNS queries. -
Graceful Shutdown:
Uses a shutdown flag and Ctrl+C handler for clean termination.
Installation
Simply install KissDNS via Cargo:
Running the DNS Server
KissDNS uses a JSON configuration file (by default, hosts.json). On the first run, if the configuration file is not found in the binary’s directory, a default configuration file will be created automatically.
You can run the server with default settings:
Or pass a custom configuration file path and/or port as command-line arguments:
-
Custom Port Only (e.g., 5532):
-
Custom Configuration File Only (e.g.,
myconfig.json): -
Both Custom Configuration File and Port:
Example hosts.json
If no configuration file is found, KissDNS creates a default file. For example:
-
records:
Maps domain names (including wildcards) to IP addresses. -
fallback_dns:
DNS server used for queries not found in your local configuration.
Debugging
KissDNS uses the env_logger crate for logging. To run with INFO-level logs:
RUST_LOG=info
Or with DEBUG-level logs:
RUST_LOG=debug
These commands will display additional log messages for easier debugging.
Test with dig and nslookup
dig
;;
;;
nslookup
Why KissDNS?
KissDNS stands for Keep It Simple, Stupid DNS. It’s designed for developers working in environments without root privileges or under strict security restrictions. KissDNS offers a quick, simple, and flexible solution for local domain resolution without complex system modifications.
License
Distributed under the MIT License. See LICENSE for more information.