Router to do NAT hairpinning

Before i used hairpin loopback nat, i used a dns solution on my EdgeRouterX.

The only difference between dns solution and hairpin loopback is that on my local network i needed to add :8123 on my local address…

How?
On my router:

  • DNS configured to use my domain name synology.me as FQDN locally
  • DHCP reservation for myHA at 192.168.1.2

So when querying myha.synology.me locally it will resolve into 192.168.1.2, but since ha is listening on 8123 and there is nothing in between my local client and ha, I need to use https://myha.synology.me:8123.

Now on the outside, i forward port 443 to 192.168.1.2:8123, meaning i can just use https://myha.synology.me/ without 8123.

And just for the fun of it i decided to get rid of :8123, so i implemented hairpin loopback nat…
But still not sure if i am going to keep it, as it created some issues when using vpn and i also feel it is slightly slower :thinking: (and if I decide to go back, I’ll probably stop forwarding port 8123 to 443, but just stick on https://myha.synology.me:8123 for both internal and external :face_with_hand_over_mouth:)

But i think i see where yours goes wrong, as you stated:

meaning, your dns resolves your external dns, and not your local FQDN :wink:

On my local network, all dhcp clients will get automatically the dns suffix synology.me.
And that domain happens to be the same as registered external😁
So basically, my local DNS and external DNS use the same name, but return totally different IP addresses :thinking:
no ngix, no pihole, no hairpin loopback and working fine…