[net] Don't use third-party "what is my IP" services.

Rebased version of  #3088

Note: this is not ready for merging yet, there are some known problems, see #3088

Dependent on #3460.