I am evaluating how to implement a solution similar to the approach of plex for embedded devices.

This solution requires defining 2^32 record for each device, creating a monster zone that easily exceeeds 10^15 entries. This is almost impossibile to deal with.

I am wondering if DNS software can offer the possibility of using a scirpt to determine the lookup result instead of having di provide all the possible entries of zone, but I am not able to find such a software.

Do you know any DNS software that allows using scripts to perform the lookup in a zone? Is there any cloud provider that offers a service based on any of the programs?

  • Wow, what an amazing question! Sad than I can give only a single up. :-)
    – peterh
    Oct 9 '20 at 8:59

You can use powerdns. It is a DNS server, where the zones are served not from text files (or from a db file) as in bind, instead they are served from configurable backends. These are mostly databases (i.e. to serve zones from mysql/postgresql/anything), but they can be also scripts. Doing it with a script, essentially we can do the analog of (f)cgi scripting, but for serving DNS requests.

Between the backends, I see two options:

  1. PostgreSQL. In theory, it is for serving the zone from postgresql tables, however postgres has very nice options for scripting/triggers with its procedural language, plpgsql. You can try to make some trigger or dynamical view functionality of it, to generate the zone run-time.
  2. (This is imho the best) Pipe:

The PipeBackend allows for easy dynamic resolution based on a ‘Coprocess’ which can be written in any programming language that can read a question on standard input and answer on standard output.

If you want to make it really fast, you could also set up a caching bind9 before the powerdns backend.

I would also suggest to not get examples from control panels. None of them is very useful. This 2^32 monster-zone is probably one of the top 10 worst ideas I've met on the whole SE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.