Do not use in production Server or if you don't know what iptables do
Add this to torrc ( located on /etc/tor/torrc):
VirtualAddrNetwork 10.192.0.0/10 AutomapHostsOnResolve 1 TransPort 9051 DNSPort 9053
Run the attached script as root so all traffic will route from Tor. you can also use attached torrc as a sample.