3 ms·
Have you ever wanted to build a toy nameserver that returns funny programmatic results? Then have a look at Python’s dnslib. Example where the magic happens i
by gorgoiler 5y ago
Have you ever wanted to build a toy nameserver that returns funny programmatic results? Then have a look at Python’s dnslib.
Example where the magic happens in ~40 lines of code:
https://github.com/paulc/dnslib/blob/master/dnslib/shellresolver.py https://github.com/paulc/dnslib/blob/master/dnslib/shellreso...
Hurricane Electric can sit in front of it if you like (and your records are dynamically generated but bounded to a known finite set), god bless them <salute>:
https://dns.he.net/ https://dns.he.net/
Example where you might want this: you wrote a nameserver that runs arbitrary shell commands!
- _paulc 5y agodnslib author here - wasn’t expecting to see this so thanks for the reference. Key thing I learnt writing dnslib (which was originally to provide a DNS API for an application) is that DNS is actually a very dynamic protocol but the complexity of mainstream servers like BIND makes it hard to do a lot of the things that you can actually do. There are a lot of problems (in particular in the service discovery space) which can be solved much more easily using DNS rather than inventing something separate. As an aside if you want an authoritative DNS server I would look at KnotDNS [1] - you can avoid all the zone file cruft and interact with it using a sensible API. If you want to write a dynamic DNS app I would look at @miekg’s excellent Go library [2] [1] https://www.knot-dns.cz/ https://www.knot-dns.cz/ [2] https://github.com/miekg/dns https://github.com/miekg/dns
- gorgoiler 5y agoThank you for your work, _paulc! I used your library to broadcast weather readings via DNS in the park where I live. It was really nice to have all the protocol work done for me, leaving me to focus on my meteoprocrastination :) There’s a special place in my heart for tools where you learn by following examples, rather than by having to read abstract documentation.