I have a few .onion address and I want to make them operation system wide aliases so everytime I entered their alias, OS resolves them to their original .onion address and and then tor opens them. I tried to accomplish this by adding them in hosts file (e.g /etc/hosts) but seems that tor does not care about hosts file. example:

fvadgbdfgbdfg5vdg46dg6v4df6gv4dfgd6f4g8vdf4g864.onion   blah.fx
g546vgvhgewg34grthrth45hg5tgt5rgrsgdfsg45gyregd.onion   foo.fx

Where can I add these aliases?


1 Answer 1


Your closest option would be tor's MapAddress option. You can use this to set up an alias for all connections made by the tor client.

For example:

MapAddress blah.fx fvadgbdfgbdfg5vdg46dg6v4df6gv4dfgd6f4g8vdf4g864.onion
MapAddress  foo.fx g546vgvhgewg34grthrth45hg5tgt5rgrsgdfsg45gyregd.onion
  • Thank you so much, it worked wherever I entered tor socks proxy address (9050), but there's still a problem. torsocks does not follow these Mapped Addresses. How to solve this one?
    – Nixmd
    Nov 20, 2020 at 15:49
  • 1
    The application you're running under torsocks is probably making a DNS request for your address, and this might not get mapped. You should instead try mapping an IP address to your onion so that the application does not make a DNS request. For example MapAddress fvadgbdfgbdfg5vdg46dg6v4df6gv4dfgd6f4g8vdf4g864.onion.
    – Steve
    Nov 20, 2020 at 18:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .