Toying with DNS | Kailash Nadh | India FOSS 3.0 | FOSS United
Here’s a summary of the key points from the YouTube transcript:
The Problem: The speaker was frustrated by the inefficiency of using search engines for simple, recurring tasks like unit conversions and weather checks. The responses were overly bloated compared to the concise nature of the queries.
The Solution (DNS Abuse): Instead of creating a traditional web service or CLI tool, the speaker built a DNS server (DNSdotoys.net) that leverages the DNS protocol’s ability to handle string-based queries and responses. This allows users to send short queries (e.g., “Bangalore weather”) and receive concise answers via DNS text records. This bypasses the overhead of HTTP requests and TLS handshakes.
Technical Details:
- DNS Protocol: The speaker explains the structure of DNS queries and responses, highlighting their concise nature compared to HTTP. The key is using TXT records to return the desired information.
- Implementation: The project uses standard DNS libraries, making the implementation relatively straightforward despite the unconventional use case. All computations are performed locally on the server to avoid upstream queries. Data is cached (weather for 1 hour, currency conversion data indefinitely).
- Functionality: The server provides various “micro-services” including weather checks, unit conversions, time zone lookups, even a coin toss! These are added by community contributions.
- Scalability: While not explicitly addressed, the 6.86 million queries received suggest a degree of scalability.
- Drawback: The solution requires two DNS queries: one to resolve DNSdotoys.net to an IP address, and a second to get the actual data. The speaker acknowledges this, suggesting caching could mitigate this.
Overall: The talk showcases a creative and efficient solution to a common problem using an unconventional approach, highlighting the flexibility (and potential for abuse) of the DNS protocol. The speaker also emphasizes the ease of implementation and the community contribution aspect of the project.