5
I have SSH access to a jump box on my work. This jump box gives access to the complete network infrastructure at work. This is great to work from home.
I am able to run a SOCKS5 proxy on the jump box (via ssh -D
) and successfully managed to configure my browser to use that SOCKS5 proxy for work hosts (via https://getfoxyproxy.org). Foxyproxy seems to forward DNS requests to that SOCKS5 proxy, so all is working fine.
My problem is that other tools, such as Maven (for building Java), is able to use a SOCKS5 proxy, but unable to forward DNS over it, unfortunately. This is a known limitation, as far as I know. So I ended up adding my work servers to /etc/hosts
.
I am looking for a more dynamic and definite solution, to remove the burden of having to maintain /etc/hosts
. In essence, I would like to keep using my ISPs DNS server as of now, but I want to forward DNS requests for my work servers (and only for them) to that jump box (either via SSH or that SOCKS5 proxy).
Is that possible?
It's certainly possible, look at
/etc/resolv.conf
, and find out which way your distro uses to set this up (systemd, ...). Then configure this service to use your jump box as DNS server. – dirkt – 2019-07-06T06:24:31.647Hi dirkt. Thank you, I will look at that. But please note, the question is not how to forward all DNS requests to the jum box, but only for hosts related to my work. So a DNS request for
google.com
, as an example, should still be handled by my ISP, and not my work. – Pritzl – 2019-07-06T06:31:48.357I saw the question title and came to say "dnsmasq!" but see you've already got that answer. Another option that I've used in the past, as I see what you want to do is simply to work from home, is to use
tmux
to maintain an active session and do all my work on the remote machine. Obviously the suitability of this depends on how beefy your remote machine is :-) – Aaron F – 2019-07-06T14:54:21.940@AaronF I thought about
tmux
, but did decide not to use it. I would rather do everything locally at home, instead in some session on some host at work. Thanks for the idea though! – Pritzl – 2019-07-07T18:43:41.387