<!DOCTYPE html>
<html>

<head>
    <title>Evan Pratten</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <!--[if lte IE 8]><script src="/assets/js/ie/html5shiv.js"></script><![endif]-->
    <link rel="stylesheet" href="/assets/css/main.css" />
    <!-- <link rel="stylesheet" href="/assets/css/custom.css" /> -->
    <!--[if lte IE 9]><link rel="stylesheet" href="/assets/css/ie9.css" /><![endif]-->
    <!--[if lte IE 8]><link rel="stylesheet" href="/assets/css/ie8.css" /><![endif]-->

    <!-- Syntax highlight -->
    <link rel="stylesheet" href="/assets/css/vs.css" />
</head>

<body>

	<!-- Wrapper -->
<div id="wrapper">

    <!-- Header -->
    <header id="header">
        <a href="http://0.0.0.0:4000//" class="logo"><strong>Evan Pratten</strong> <span>retrylife</span></a>
        <nav>
            <!-- <a href="#menu">Menu</a> -->
        </nav>
    </header>

    <!-- Menu -->
    <!-- <nav id="menu">
	<ul class="links">
        
		    
		
		    
		
		    
		
		    
		
		    
		        <li><a href="http://0.0.0.0:4000//">Home</a></li>
	    	
		
		    
		
		    
		
		    
		
		
		    
		
		    
		
		    
		        <li><a href="http://0.0.0.0:4000/all_posts">All posts</a></li>
		    
		
		    
		
		    
		
		    
		
		    
		
		    
		
	</ul>
	<ul class="actions vertical">
		<li><a href="#" class="button special fit">Get Started</a></li>
		<li><a href="#" class="button fit">Log In</a></li>
	</ul>
</nav> --> 
	
	<section id="banner" class="major" style="height:40vh">
			<div class="inner">
				<header class="major">
					<h1>devDNS</h1>
				</header>
				<div class="content">
						<p>The DNS over devRant service</p>
						
					</div>
			</div>
		</section>
    
    
<!-- Main -->
<div id="main" class="alt">

<!-- One -->
<section id="one">
	<div class="inner">
		
		<p></p>
<p>Over the past year and a half, I have been hacking my way around the undocumented <a href="https://devrant.com">devRant</a> 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 <a href="https://devrant.com/collabs/2163502">devDNS</a> over the past few days that uses this undocumented API. Why must I be so bad at writing intros?</p>

<h2 id="what-is-devdns">What is devDNS</h2>
<p>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:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@devDNS example.com
</code></pre></div></div>
<p>or</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@devDNS MX example.com
</code></pre></div></div>
<p>Of course, <code class="highlighter-rouge">MX</code> and <code class="highlighter-rouge">example.com</code> are to be replaced with the domain and entry of your choosing.</p>

<p>devDNS was inspired by <a href="https://twitter.com/1111resolver">@1111Resolver</a>, and the source is available on <a href="https://github.com/Ewpratten/devDNS">GitHub</a>.</p>

<h2 id="how-it-works">How it works</h2>
<p>The Python script behind devDNS is very simple. devDNS does the following every 10 seconds:</p>
<ul>
  <li>Fetch all new notifs</li>
  <li>Find only mentions</li>
  <li>Spin off a thread for each mention that passes a basic parser (Is the message 2 or 3 words long)</li>
  <li>In the thread, check if the message is a control message (allows me to view the status of the bot via devRant)</li>
  <li>Check if the request matches a required pattern</li>
  <li>Call <code class="highlighter-rouge">dnspython</code> with requested record and domain</li>
  <li>Receive answer from a custom <a href="https://pi-hole.net/">PIHole</a> server with caching and super low latency</li>
  <li>Send a comment with the results to the requester</li>
</ul>

<p>Thats it! Super simple, and only two days from concept to reality.</p>

<h2 id="where-is-this-hosted">Where is this hosted?</h2>
<p>This program is hosted on a raspberry pi laying in my room running docker. I also have <a href="https://www.portainer.io/">Portainer</a> set up so I can easily monitor the bot from my phone over my VPN.</p>

	</div>
</section>

</div>

    <!-- Footer -->
<footer id="footer">
    <div class="inner">
        <ul class="icons">
            
            <li><a href="https://twitter.com/ewpratten" class="icon alt fa-twitter" target="_blank"><span class="label">Twitter</span></a></li>
                  
            <li><a href="https://gitlab.com/u/ewpratten" class="icon alt fa-gitlab" target="_blank"><span class="label">GitLab</span></a></li>
             
            <li><a href="https://github.com/ewpratten" class="icon alt fa-github" target="_blank"><span class="label">GitHub</span></a></li>
              

            <li><a href="/feed.xml" class="icon alt fa-rss" target="_blank"><span class="label">RSS</span></a></li>
        </ul>
        <ul class="copyright">
            <li>© Evan Pratten</li>
            <li>Design based from: <a href="https://html5up.net" target="_blank">HTML5 UP</a>
</li>

        </ul>
    </div>
</footer>

</div>

<!-- Scripts -->
<script src="http://0.0.0.0:4000/assets/js/jquery.min.js"></script>
<script src="http://0.0.0.0:4000/assets/js/jquery.scrolly.min.js"></script>
<script src="http://0.0.0.0:4000/assets/js/jquery.scrollex.min.js"></script>
<script src="http://0.0.0.0:4000/assets/js/skel.min.js"></script>
<script src="http://0.0.0.0:4000/assets/js/util.js"></script>
<!--[if lte IE 8]><script src="http://0.0.0.0:4000/assets/js/ie/respond.min.js"></script><![endif]-->
<script src="http://0.0.0.0:4000/assets/js/main.js"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-74118570-2"></script>
<script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments);
    }
    gtag('js', new Date());

    gtag('config', 'UA-74118570-2');
</script>

</body>

</html>