The implementation is based on an awesome dns library from Miek Gieben. The implementation starts a tcp and a udp server on 53 port and uses Cloudflare DNS over TLS as a upstream DNS resolver.
To build the project Makefile is provided. cd into the directory and run the following command.
$ make buildThe above command builds the project and creates a docker image abhinav/dns-client-proxy. Thereafter removing the build binary.
To run the container use the following command.
$ sudo docker run -d --rm -p53:53 -p53:53/udp abhinav/dns-client-proxyThis will start the server on 127.0.0.1:53 binding localhost 53 port.
To test the application on linux you can use dig command.
$ dig @127.0.0.1 www.zomato.comIf everything goes well you may see the dig output. The dig is communicating to localhost at 53 port which in turn uses cloudflare DNS for resolution