4

I'm setting up a NAS server for my company. From the outside it is accessible through mydomain.dyn.com, from the local network it can be accessed through its local IP address. The problem is that I can't connect to the server using domain name from within the local network (or public IP). I am assuming the ISP is blocking the access. One solution, I think, would be running a DNS server locally so that it resolves the domain name to the local IP when on a local network.

I've read that it might be possible to configure that function on some routers. We are planning to get a MikroTik router, so my question is, is it possible to have that configuration on that router, and what general steps I need to take to configure this?

aschultz
  • 107
  • 1
  • 1
  • 7
CodeBreaker
  • 159
  • 4
  • Google Hairpin NAT – Sven May 18 '17 at 09:25
  • Thank you very much. PS. This is in a business environment. I just used 'I' here. I will reword the question. – CodeBreaker May 18 '17 at 10:14
  • Probably your question doesn't look enough professional and thus our community voted it to close by a community vote. I think your question would be a better match on http://superuser.com . – peterh May 18 '17 at 12:42

1 Answers1

6

Hairpint NAT (sometimes called NAT Reflection) is what you need here. Some routers will do this automagically (often the cheap consumer ones will), but others will not (Mikrotik will not, but is a very capable and featured router and I recommend them).

Essentially you have to NAT from the inside interface of your router back to the inside of your network. Typically when you NAT you NAT from an outside interface.

Your other option, as you've suggested, is your own internal DNS serving a different IP address. This is called "Split Horizon DNS" and could be a suitable option - especially as it will reduce load on your router. Even with hairpin nat, all of your traffic will have to hit the router and be NATted back to the NAS. This limits your NAS bandwidth to what your router can push through. Your new MikroTik router can absolutally do this as well - it has the ability to override DNS entries, as long as you are using it as your resolver on your network.

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255