From c9b53149be8253f1bfc122c62870debcb7c54cd7 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 1 Jul 2019 22:38:27 -0400 Subject: [PATCH] devDNS --- _posts/2019-07-01-devDNS.md | 38 ++++++ _site/all_posts.html | 7 ++ _site/feed.xml | 71 +++++------ _site/index.html | 4 +- _site/projects/2019/07/01/devDNS.html | 175 ++++++++++++++++++++++++++ 5 files changed, 253 insertions(+), 42 deletions(-) create mode 100644 _posts/2019-07-01-devDNS.md create mode 100644 _site/projects/2019/07/01/devDNS.html diff --git a/_posts/2019-07-01-devDNS.md b/_posts/2019-07-01-devDNS.md new file mode 100644 index 0000000..4ee153d --- /dev/null +++ b/_posts/2019-07-01-devDNS.md @@ -0,0 +1,38 @@ +--- +layout: post +title: "devDNS" +description: "The DNS over devRant service" +date: 2019-07-01 22:13:00 +categories: projects +--- + +Over the past year and a half, I have been hacking my way around the undocumented [devRant](https://devrant.com) auth/write API. At the request of devRant's creators, this API must not be documented due to the way logins work on the platform. That is besides the point. I have been working on a little project called [devDNS](https://devrant.com/collabs/2163502) over the past few days that uses this undocumented API. Why must I be so bad at writing intros? + +## What is devDNS +devDNS is a devRant bot written in python. It will serve any valid DNS query from any user on the platform. A query is just a comment in one of the following forms: +``` +@devDNS example.com +``` +or +``` +@devDNS MX example.com +``` +Of course, `MX` and `example.com` are to be replaced with the domain and entry of your choosing. + +devDNS was inspired by [@1111Resolver](https://twitter.com/1111resolver), and the source is available on [GitHub](https://github.com/Ewpratten/devDNS). + +## How it works +The Python script behind devDNS is very simple. devDNS does the following every 10 seconds: + - Fetch all new notifs + - Find only mentions + - Spin off a thread for each mention that passes a basic parser (Is the message 2 or 3 words long) + - In the thread, check if the message is a control message (allows me to view the status of the bot via devRant) + - Check if the request matches a required pattern + - Call `dnspython` with requested record and domain + - Receive answer from a custom [PIHole](https://pi-hole.net/) server with caching and super low latency + - Send a comment with the results to the requester + +Thats it! Super simple, and only two days from concept to reality. + +## Where is this hosted? +This program is hosted on a raspberry pi laying in my room running docker. I also have [Portainer](https://www.portainer.io/) set up so I can easily monitor the bot from my phone over my VPN. \ No newline at end of file diff --git a/_site/all_posts.html b/_site/all_posts.html index f3f0021..1f252b4 100644 --- a/_site/all_posts.html +++ b/_site/all_posts.html @@ -92,6 +92,13 @@