0

This is a problem which is driving me crazy lately.

I use dynamic DNS to connect to a home server. Let's call the dynamic host my.home.net. I use ddclient to update the DNS record every few minutes, then I access my machine over SSH. Pretty standard. That works great when I am out and about, but I cannot access my server using the dynamic host address when I am inside my home network.

The upshot of this is that I often find myself configuring everything twice. For example I have git repos on my server and I end up adding two remotes, one for external access via my.home.net and another for internal access via local IP address.

This is annoying, so I hope to fix it. Something tells me this is the fault of my DSL router's DNS implementation, but I am not sure. I have prodded around in the router setting and I don't see anything that could help.

Has anyone had the same issue? Do you know a workaround/fix?

Thanks!

2 Answers 2

3

Routers typically don't route back to the internal servers. If you have a server running DD-WRT or a similar O/S you may be able to enable hairpin routing to do this. Your router may allow you to configure routeback which enables hairpinning.

Your router is likely forwarding the DNS request out to your dynamic DNS provider. Some routers allow you to configure local entries, in which case you configure the domain you connect to with the internal IP address of your server.

I generally run an internal DNS server which serves up the real (internal) IP address of my servers. bind is likely overkill and I often use dnsmasq which is easy to setup and run on Linux/Unix platforms. There are similar options for Windows. The DNS settings on the router should be updated to use this server rather than the default one. DHCP can be configured to specify the internal DNS server as the default.

4
  • Looks like I will have to put a Soekris between the router and the rest of the network. Jun 23, 2014 at 0:15
  • And thanks for making we aware of dnsmasq. That's a neat tool. Jun 23, 2014 at 0:21
  • @vext01 You should be able to configure your DNS to send the IP address of your internal DNS server.
    – BillThor
    Jun 23, 2014 at 0:59
  • yes I could, although i don't currently have an internal DNS server. Jun 23, 2014 at 16:08
0

I had a similar problem accessing my home server from within my own network. My router apparently refused connection from any source with its own IP address. I solved it by using a VPN (In my case, Private Internet Access). When I had the VPN active, I was able to access my home server via the DNS name.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .