I know this is an old question but it was on my favourites list so I guess I was intending to answer it :)
From what I can tell it is not actually possible to reliably get the external IP of the current server, PHP only sees it as localhost so it will just show "127.0.0.1" or "::1" for the IP.
I think the best way is through Dev Tools as you mention. You just go to Network tab, click the first entry for the actual page, and it shows the IP. You can also use a command line and enter
and it will show you the IP it's trying to connect to.