1.Use a specified port (e.g., 12345) for SSH SOCKS server:
ssh -D 12345 user@host.domain
2. Go to the setting menu in Firefox, then Advanced->Network->Connection->Settings
3.Check the “Manual proxy configuration”, fill in SOCKS host (127.0.0.1) and port (your specified port, 12345 in our example)
4. Also, type in “about:config” in the address bar in Firefox, change “network.proxy.socks_remote_dns” to true.
Reference