Skip to content

hyperenju/tc-dns-cache

Repository files navigation

tc-dns-cache

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.

Egress path (Search for cached entries)

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.

Ingress path (Save entries into cache)

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.

Installation and cleanup

$ export NIC=<interface name>
$ make # installation
$ make clean # cleanup

About

eBPF-based DNS cache and blocker for DNS resolvers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published