Term/technique for local network lookup of CNAME/A record pointing to local network?

I don’t know the exact term for it, but I’ll explain what I mean:


  • I have a home network and a work network
  • On both networks, I have an IP address 192.168.1.40 that runs a webserver
  • I have set up portforwarding on both routers so that port 80 (192.168.1.40) is visible to the outside world - tested and working
  • I have pointed a CNAME to my publicly available domainname (in my case a Fritz router domain name + a Mikrotik cloud domain name) for home.domain.name and work.domain.name - tested and
  • working from the outside world

Both work fine if I try to reach them from the outside world. So that’s no problem. But …


  • When I try to connect to my home.domain.name from my internal HOME network (Fritz router) it works perfectly
  • When I try to connect to my work.domain.name from my internal WORK network (Mikrotik router) it DOES NOT work

I’m trying to get the name of the “term/technique” that’s being used to connect to my own network with a CNAME/A assigned domain name, so I can try and find out why it’s working with my Fritz router and not with my Mikrotik router.

I can think of at least two approaches here.

The first approach is a so called split-horizon DNS. I don’t think you can do this on a Mikrotik router, an external DNS server is required.

The second approach is “hairpin NAT”. Search the forum, there are plenty of example here.

Yes, hairpin nat, one fix is to move the server to a different subnet, problem solved.
as noted lots of examples if you ‘search’ hairpin nat.

If on your office the mikrotik routerboard act as dns, simply put on /ip dns static the work.domain.name resolved as internal server IP.
Done.

So this is the fourth method of approaching Hairpin NAT then,as I read a long time ago…but had forgotten?
So what does this do?
Why is the router going to use the static DNS, what happens if you have other servers on the list of DNS servers,
What if peer DNS is allowed?

dnsworkaround.JPG

On image the IP address of local server go to… address field and the work.domain.name go on… name.

or skip name and add a regexp like (^|www.)work.domain.name$

Static DNS have precedence above any settings on DNS.

If the workstation on office have main server used as main DNS, simply put here the rule.