It can be useful to browse the web from another location. This trick can be used with jailbroken iPhones, to test what sites look like from remote locations, etc.
The first thing to do is establish an SSH connection with “dynamic port forwarding.” This can be done with the command:
ssh -D 8080 -Nf <hostname>
-C flag can be added to the command to enable compression.
Once that’s done, tell Firefox to connect using this proxy. The settings will look like the image below:
Finally, DNS requests through the proxy can be configured by entering
about:config in the firefox address bar. Then search for the setting
network.proxy.socks_remote_dns and double click it to make it True.