<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.n4vx.net/index.php?action=history&amp;feed=atom&amp;title=TOR_and_Regular_DNS_in_Ubuntu</id>
	<title>TOR and Regular DNS in Ubuntu - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.n4vx.net/index.php?action=history&amp;feed=atom&amp;title=TOR_and_Regular_DNS_in_Ubuntu"/>
	<link rel="alternate" type="text/html" href="https://wiki.n4vx.net/index.php?title=TOR_and_Regular_DNS_in_Ubuntu&amp;action=history"/>
	<updated>2026-12-06T09:25:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.13</generator>
	<entry>
		<id>https://wiki.n4vx.net/index.php?title=TOR_and_Regular_DNS_in_Ubuntu&amp;diff=716&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;From: [https://cdn.hackaday.io/files/12985555550240/Linux%20DNS%20Resolver%20for%20Onions.txt Here]  This is a simple HOWTO to allow any program in Linux to resolve Onion addr...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.n4vx.net/index.php?title=TOR_and_Regular_DNS_in_Ubuntu&amp;diff=716&amp;oldid=prev"/>
		<updated>2021-01-08T00:32:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;From: [https://cdn.hackaday.io/files/12985555550240/Linux%20DNS%20Resolver%20for%20Onions.txt Here]  This is a simple HOWTO to allow any program in Linux to resolve Onion addr...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;From: [https://cdn.hackaday.io/files/12985555550240/Linux%20DNS%20Resolver%20for%20Onions.txt Here]&lt;br /&gt;
&lt;br /&gt;
This is a simple HOWTO to allow any program in Linux to resolve Onion addresses seamlessly, without proxy settings. I have been running this for over a year, and currently 10 HS nodes. This, however, is EXPERIMENTAL.&lt;br /&gt;
&lt;br /&gt;
The reason for this, is I wanted to run Node-Red and other applications and send data via Tor, while still being able to communicate with my Node-Red instance locally. Other programs I also use don&amp;#039;t always have settings to add Proxy settings. Using this modification, using the local proxy is no longer needed, as the underlying resolver does that for you.&lt;br /&gt;
&lt;br /&gt;
Hazards: Standard IP queries go through the standard network. In other words, if something in [key].onion calls to google.com, the call to google goes through your NON-Tor link. DNS is also similarly NOT PROTECTED, unless you are using a [dns server].onion , and put that in your resolver.&lt;br /&gt;
&lt;br /&gt;
To get started, Get the following packages (Ubuntu, Debian): &lt;br /&gt;
 sudo apt-get install tor iptables dnsmasq dnsutils&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add the following to the /etc/tor/torrc file:&lt;br /&gt;
 VirtualAddrNetworkIPv4 10.192.0.0/10&lt;br /&gt;
 AutomapHostsOnResolve 1&lt;br /&gt;
 TransPort 9040&lt;br /&gt;
 DNSPort 53&lt;br /&gt;
 DNSListenAddress 127.0.0.2&lt;br /&gt;
&lt;br /&gt;
Now, restart Tor:&lt;br /&gt;
 sudo service tor restart&lt;br /&gt;
&lt;br /&gt;
Edit /etc/dnsmasq.conf and add the following: &lt;br /&gt;
 listen-address=127.0.0.1&lt;br /&gt;
 resolv-file=/etc/realresolv.conf&lt;br /&gt;
 server=/onion/127.0.0.2&lt;br /&gt;
&lt;br /&gt;
Make a new file, called /etc/realresolv.conf . Add this in the file: &lt;br /&gt;
 nameserver 8.8.8.8 (or whatever DNS server you choose)&lt;br /&gt;
&lt;br /&gt;
Restart DNSmasq: &lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the IPtables firewall update for redirection &lt;br /&gt;
 sudo iptables -t nat -A OUTPUT -p tcp -d 10.192.0.0/10 -j REDIRECT --to-ports 9040&lt;br /&gt;
&lt;br /&gt;
Also, this script must be run at every boot, so add this in /etc/rc.local, ABOVE the &amp;quot;exit 0&amp;quot; &lt;br /&gt;
 /sbin/iptables -t nat -A OUTPUT -p tcp -d 10.192.0.0/10 -j REDIRECT --to-ports 9040&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>