ImportError: No module named dns.message
<p>When I try to run <code>sudo python dns2proxy.py</code> in Ubuntu, I keep getting this error:</p>

<pre><code>Traceback (most recent call last):
  File "dns2proxy.py", line 21, in &lt;module&gt;
    import dns.message
ImportError: No module named dns.message
</code></pre>

<p>I have the correct repository cloned (<a href="https://github.com/LeonardoNve/dns2proxy.git" rel="nofollow">see here for GitHub link</a>) and I'm in the correct directory. I've tried running it in Kali linux and it works flawlessly. My intention is to do a <code>gnome-terminal -e "sudo python dns2proxy.py"</code> and make the command run in another terminal.</p>

<p>Try running the command</p>

<pre><code>pip install dnspython
</code></pre>

<p>or, if you are using your system Python (not recommended)</p>

<pre><code>sudo pip install dnspython
</code></pre>

<p>This will install the <code>dns</code> package that is currently missing. If, as you say, you have cloned the repository and want to use that version (and possible edit it) you may instead use</p>

<pre><code>[sudo] pip install -e .
</code></pre>

<p>from the cloned directory.</p>

python linux dns