checking for an IP address wouldn't work if you are on a LAN. The most reliable way? Try and connect to some host:port you KNOW is up and running. If it connects, you're on the internet, if not, then you aren't. That could be scripted. You'd just make a socket that connects to say... google.com (which I personally have never seen down). If the connect fails, then you're not on the internet, if it succeeds, then you are.