3

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?

  • Google Hairpin NAT – Sven May 18 '17 at 9: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 superuser.com . – peterh - Reinstate Monica May 18 '17 at 12:42
5

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.

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.