This question already has an answer here:

I've asked this question and even searched around but didn't get a useful answer for me.

Basically what im doing is i have a webserver on internal ip port 80. So if im in the network it would be accessible if i type in

Ok no prob so far. Now, i would like for internal network users to access it via our public static ip which is 219.92.xx.xxx/myportal/login.php

If im outside of this network, no problem.i can access it. But how do i make it so that if im in the internal network, i can use the public ip?

now it's not practical because i have to use two different address depending on my network situation.

Why i want this? simple. because i want to buy a domain name and use it with my public ip which im hosting my own webserver. so now i cant access using public ip inside, i wont be able to use my domain later assigned to that ip.

for example, i wont be able to access it via www.vportal.com/myportal/login.php if im inside the network. so to conclude, it's not practical am i right? i would need to use internal ip when im inside. only can use domain,when im outside.

Now, im certain there is a way around this but i really hope someone can give me some idea or solution because i am NOT a network person. but i do know all the basics.

FYI, my setup is a simple setup which is modem and router.one server is using wired connection. my router is dlink dir615. now what can i do with what i got now?is it possible?

i've read about nat loopback but i know it's not possible for my situation. i really hope somebody can help and explain to me in layman's way. i really want to learn this.


marked as duplicate by MadHatter, mdpc, Ward, dawud, MichelZ Jul 12 '14 at 16:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Can you use a DNS name? And implement a split DNS view? – Shane Madden May 16 '12 at 5:23
  • the right keyword for this would be 'hairpin nat', but not sure how to do it with your dlink – mulaz May 16 '12 at 5:44
  • regarding the router configuration, is there a port forwarding, say port 80 points to port 80 ? – Rony May 16 '12 at 6:09
  • @ShaneMadden im not familiar with ur suggestion. could you elaborate? – James May 16 '12 at 8:02
  • @mulaz yes, i have read about that as well. – James May 16 '12 at 8:02

Mulaz did come up with the right keyword: http://wiki.mikrotik.com/wiki/Hairpin_NAT

The link has diagrams which visualizes the problem and answer more succinctly.

Nat settings conflicts with my port forwarding settings on my router so sometimes a local dns server on a linux server may be required. Your mileage may vary.

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