2

I have a server and a laptop in my LAN. The LAN is connected to the internet via router. I forward port 22 to the server and have a dynamic DNS provider (namely "no-ip") alias my router's internet IP to the domain myserver.noip.org.

When I'm outside of my LAN I can ssh into my server from anywhere just fine and dady as expected by using:

ssh confus@myserver.no-ip.org

When I use the same command from inside my LAN, I get "no route to host" and the ssh connection fails. When I use the servers local IP address, like so

ssh confus@192.168.0.10 # <--- Same server!!!

it works.

How can I get the myserver.no-ip.org dynamic DNS to wrok locally?

con-f-use
  • 18,613
  • 20
  • 88
  • 142
  • Are you able to ping the no-ip address from any computer inside your network? If not, have you tried changing your DNS settings to use something like OpenDNS or Google DNS servers? Can you ssh into the server when you use your public facing ip address (not the internal 192.168 address)? – blendenzo Dec 29 '16 at 23:45
  • 3
    To answer the question as phrased in the title: because your router does not support [hairpin NAT](https://en.wikipedia.org/wiki/Hairpinning). – user4556274 Dec 30 '16 at 00:27
  • I actually have the Google DNS servers in my network configurations. I can ping from the inside of my network. I cannot ssh into it from within the network using the "pubilc facing", i.e. internet IP instead of the local IP from within the local network. – con-f-use Dec 30 '16 at 00:29
  • 1
    con-f-use, you might try pointing your router's DNS setting at a server on your network (you could use the same server you're trying to SSH into), and then set up that machine to use Google's DNS. Then on the internal server you point your router's DNS to, locally define myserver.no-ip.org in the /etc/hosts file as 192.168.0.10. That should allow you to use the domain name inside your network and avoid the hairpinning problem. @user4556274 I learned something new today. I had not heard of hairpinning, but it sounds like that is what is going on there. – blendenzo Dec 30 '16 at 01:15

0 Answers0