I have never had to use hairpinning in the past and so far, reading its description on Wikipedia, I don't see many use cases for this technology, apart from some requests from selected users inside the network who would like to use some P2P application.

What are the common, practical use cases for hairpinning?

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Aug 11 '17 at 16:45

Nat loopback is useful when you have some DNS issue.

Imagine that you host your own email server inside the network. You need to access it when you are in the office and when you are outside.

Your mail client is configured to access it with the name mail.example.com.
If you don't use split DNS, for whatever reason, this name will always be resolved to the public IP address.

Without NAT loopback this server will not be accessible from the internal network because you try to access an internal ressource from an internal interface trough an external interface.


There are two different situations to consider.

One is where two hosts behind the same nat try to use STUN or similar to set up a peer to peer connection. This is useful for peer to peer applications. Esepecially in a double NAT secnario or where the NAT has multiple public IPs (many peer to peer applications.will try to connect using private IPs if two clients have the same public IP).

The other is when you have servers on your lan that you want to access from both inside and outside. You want to access these servers from both inside and outside. If your NAT allows the port forwards to loop back then you can just use the public IP everywhere. If it doesn't then you need to mess arround with split DNS.

Note that some implementations may support one of these scenarios but not the other.

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.