When setting up a laptop to be able to use an IP application (such as
messenger or an app hosted on my terminal server) I need apps to work both
when attached to the network and when connecting over the internet.

What I've been doing is to create a DNS entry on my internal DNS server that
points to the internal address ( and a different entry on the
public DNS server that that uses the same name but points to the external
address. Once that's done I can point the application to the address and it
resolves correctly whether it's internal or external.

It works well in most cases but I was wondering if anyone had a better way
of doing it.

Does anyone know how to get an application to determine whether or not it is
local to the network?