FreeBSD ports use without DNS/direct connectivity.
1) Set up an SSH SOCKS5 tunnnel.
$ ssh -fND localhost:1080 routed_host
2) Override the fetch(1) defaults (documented in /usr/ports/Mk/bsd.port.mk).
$ export DISABLE_SIZE=1
$ export FETCH_CMD="curl --socks5-hostname localhost --remote-name"
3) Work normally. If using sudo(8), remember "-E" (to pass the environment variables above).
4) Clean up by killing the SSH SOCKS5 tunnel.