RubyDNS can be used as a flexible DNS server, either processing requests directly or passing them upstream. Here is an example of a very basic server:
If you run this program, you can use dig
to see the result of the manipulation:
Here is the output from the server running in debug mode: