What's new

Enabling TOR break local DNS resolution

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

questorian

New Around Here
I was playing with TOR feature and was quite impressed with t the response - I thought it would be much worse than that. Anyway I noticed that all my hosts added to hosts.add no longer get resolved and that is confirmed by NSlookup - when I turn off TOR they are back again.

anyway to have both?

Thanks to Merlin for fantastic software!
 
Maybe something is stepping on your /jffs/configs/hosts.add file? Here's a better way to append to /etc/hosts:

/jffs/scripts/hosts.postconf
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh

# append the user hosts file to the firmware hosts file
APPENDFILE="/jffs/scripts/hosts.user"
while read TEXTLINE
do
  TEXTLINE=${TEXTLINE//\"}
  pc_append "$TEXTLINE" "$CONFIG"
done <$APPENDFILE

# append the NTP hosts file to the firmware hosts file
APPENDFILE="/jffs/scripts/hosts.ntp"
while read TEXTLINE
do
  TEXTLINE=${TEXTLINE//\"}
  pc_append "$TEXTLINE" "$CONFIG"
done <$APPENDFILE
 
hmmmmm....I must admit I have no idea what this is doing - but I will give it a try and report back.

Thank you hardtotell for taking time to reply...I though hosts.add was recomended way to add entries to hosts file.
 
I thought hosts.add was recommended way to add entries to hosts file.
Yes, I'm struggling to see how this is better than hosts.add. It doesn't appear to offer any benefits and is therefore unnecessarily complicated. :confused:

If the issue is a corrupted hosts file it would be easy enough to log on to the router and check it for errors. But as the hosts file works OK when TOR is turned off it seems unlikely that that is the problem.

When TOR is active what is the IP address of the DNS server? Is it still the router (192.168.0.1) or has it changed?

What does /tmp/etc/dnsmasq.conf contain when TOR is active?
 
Last edited:
My example, which has been simplified, is useful when you have both a list of fixed hosts and a list of dynamically generated hosts that gets appended to /etc/hosts. The DNSCrypt wiki has a wan-start script that overwrites the hosts.add file. Not sure if you are doing anything like that.

/jffs/scripts/hosts.postconf
Code:
#!/bin/sh
CONFIG=$1
cat /jffs/scripts/hosts.user>>"$CONFIG"
cat /jffs/scripts/hosts.ntp>>"$CONFIG"
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top