1

I'm trying to set up DynDNS for a personal computer on my home network for SSH access. I've got DynDNS set up, and managed to get the router forwarded correctly so that any connection attempts to port 22 on the dyndns host name point to the appropriate computer, which responds with openssh. Everything works fine as long as the connection attempt comes from an external network. If I try to connect from a different computer attached to the same router, it just stalls out. I can't figure out what I need to do to be able to use the dyndns host name to connect to my ssh server from within the same network. Any insight appreciated.

1

The DynDNS DNS name maps to a public IP. The IP of the SSH box on your local network is a private IP.

Your router only accepts connections to it's public IP on it's WAN port.

{Internet} --- [WAN PORT {public IP}  (router)   {private IP} LAN PORT] --- {local network}

The DNS is probably resolving fine, but the router is blocking you attempting to connect to it's public IP from the LAN PORT (aka interface).

The easiest way to deal with this is to just use the private IP to the box when on the LAN. It is possible to setup dual zoned DNS so that it will resolve correctly both in the LAN and outside. But I doubt this is something worth the time.

A simple workaround would be to make an entry in your hosts file on the machine you want to SSH from. For instance, make a special entry like sshbox.local and use that DNS name when on the LAN.

...If you are up for it, here are some examples of how to setup a DNS server in this situation:

I used multiple view DNS some years ago, and it works well once set up. On advantage of doing this is your reverse DNS (which you should setup) will make local connection operate faster. This is probably one of the biggest things missing in most corporate networks.

| improve this answer | |
  • Setting up two entries in the config file was my first thought but I want a more elegant solution if at all possible. I want to be able to use the host name from anywhere, even right next to the box. – Thought Space Designs Dec 30 '13 at 5:06
  • You could have a more elegant solution, if you wanted to invest a fair bit of effort into it. The easiest way is to use the hosts file. Second easiest would be to setup an internal DNS server and have an entry in there to point to the SSH host and have all local computers query the internal DNS server first. – Lawrence Dec 30 '13 at 5:49
  • Do you have any resources for setting up an internal DNS server? I'm not opposed to it I'm just not familiar with actually setting up a local DNS server. – Thought Space Designs Dec 30 '13 at 5:51
  • I updated the response with some examples... – EdH Dec 31 '13 at 3:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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