Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  • PC1 is connected via VPN to server1 (s1)
  • s1 is connected to pc1 via VPN tunnel and to s2 vie ssh. There is transparent proxy and iptables rules that take traffic from VPN and push to ssh SOCKS5.
  • s2 is connected in local lan with some servers that hosts pages like:
  • s3:
  • s4:

What I want to is to after entering in web browser on PC1: get to this site. Now I can do it only by entering IP address.

Edit /etc/hosts on pc1 will solve the problem probably - but I can't do that. Edit /etc/hosts on s1 - didn't help, /etc/hosts on s2 contain all necessary entry but also not solving this problem. I'm looking for some simple solution, maybe some chain for iptables, or very simple DNS. Have you got any ideas?

share|improve this question

If all your traffic goes though the VPN you simply need to change the secondary dns in your /etc/resolv.conf to point to the dns server used by the servers Lan. By doing so, your browser will know where to look for S1 or S2 services.

If only some traffic goes through the VPN, your setup is similar to mine. Most of my traffic goes through my local lan, but a few requests are redirected to the company servers on another continent. After running my vpn client I have to run the following script to make things work:

ip route add xx.xx.0.0/8 dev ppp0
ip route add dev ppp0
ip route add xx.xx.92.151 dev ppp0
ip route add xx.xx.92.137 dev ppp0
vpn="`ifconfig | grep -A1 ppp | grep inet | awk '{ print $2 }' | awk -F":" '{print $2}'`"
sudo route delete default gw $vpn

PS: I have of course replaced the IPs of my company with XX.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.