Why no “what's my ip” well-known port/service?

I know there are some web sites that provide this service but given that pretty much everyone lives behind NAT these days, why isn't this standardized on a port and provided as a service to whomever wants to run it? It's at least as useful as an echo, daytime or "quote of the day" server and as easy to implement.

Or does one exist that I am aware of? Any proposals/RFCs in progress?

EDIT: Thanks to everyone for a lively and thoughtful discussion.


It's standarised with the STUN protocol in RFC 5389

Of course, vendors have to support standards to make them useful.

Related threads on StackOverflow. They all mention STUN:

    <li>Discovering public IP programatically</li> <li>Trying to get NAT’s external IPAddress with INATExternalIPAddressCallback in C#</li> <li>Obtaining Own External IP Address in POSIX C </li> </ul>


    You really need more than to know what your IP address is "right now". You need to have it stay that way.

    More importantly, it seems that the reason you need to know your IP address is that you need to tell some other machine how to connect to you. What's really needed, then, isn't a low-level hack, but rather some protocol that configures all interested Network-layer devices to make sure that you can be reached, and that the connection stays open (or that it can reconnect if broken).

    For instance, it's possible for your router to lose its connection to your ISP. When it gets a new connection, it could have a different IP address. You need to address that problem. In a Corporate environment (yes, corporations do use P2P), any number of network reconfigurations may take place, all without informing the peers about changes in IP address. This needs to be addressed as well.

    The overall problem is that you're depending on a Network-layer entity (IP Address) to remain useful for the upper layers. That's not the job of an IP address - it's only meant to get your datagrams to their destination. There's nothing inherent in knowing your IP address that says they'll still get to their destinations tomorrow by using that same address.


    If such a peername service existed, your NAT gateway could choose to modify the service's response, replacing the external address with the internal one, again.

    Also, in case of a double-natted system: how would you get at the middle address?


    There's going to be no widespread fix. 'When/if IPv6 ever fully replaces IPv4 then the abundance of available addresses will make NAT, and thus this issue, a thing of the past.


  • How to search for exact matching string in a text file using Ruby?
  • array missing elements with a subroutine thread
  • How to serialize JSON key containing dots (like e.g. IP address) with SuperObject?
  • How do I get the local IP address in Go?
  • spring cloud netflix - using EurekaClient without Jersey throws unrecognized field exception
  • Getting WSAEWOULDBLOCK error always while calling recv() socket function for receiving data
  • Heroku django no such app
  • Accessing Active Directory using C
  • Using ASP.NET PageMethods with JQuery DataTables?
  • How to verify signed cookies are valid on the front-end?
  • cannot install pear install phpunit/PHPUnit_Selenium
  • Why no “what's my ip” well-known port/service?
  • jQuery: FadeIn and FadeOut li's and start over at the last li
  • Left Join to most recent record
  • Get Attribute XML in JTree
  • IP address of Azure API App and how to restrict IPs
  • Send http request through specific network interface
  • How to avoid using dynamic variables / a billion if statements in Java?
  • Google cloud datastore emulator init data
  • Google OAuth2 for an web application hosted behind NAT (intranet server without public IP)
  • How to resolve docker host names (/etc/hosts) in containers
  • Should I be afraid to use UDP to make a client/server broadcast talk?
  • how to get username into sql trigger when multiple users signed on from asp membership
  • Cannot resolve symbol 'MyApi'
  • Validaiting emails with Net.Mail MailAddress
  • sending/ receiving email in Java
  • Cannot Parse HTML Data Using Android / JSOUP
  • JTable with a ScrollPane misbehaving
  • unknown Exception android
  • failed to connect to specific WiFi in android programmatically
  • How can I use threading to 'tick' a timer to be accessed by other threads?