This program is for DNS resolvers (clients), who ask a full resolver for name resolution. These programs only support A records and up to 1 CNAME record. If a type of query or answer types are not supported, these programs take no action.
Before passing down a packet, this program inspects a DNS (UDP/53) packet to a full resolver and checks if the query is cached or not. If the query is cached, this increases the packet size and fills the packet with the answer of the query, then transmits the packet to the source address (itself) from the same interface. If not, this does nothing.
Additionally, this also works as a DNS blocker. When the query packet attempts to resolve domains which are listed in blocklist.txt, this program responds with NXDOMAIN on behalf of the upstream DNS full resolver.
Before passing up a packet, this program inspects a DNS (UDP/53) packet from a full resolver and saves the query and answer into the cache.
$ export NIC=<interface name>
$ make # installation
$ make clean # cleanup