RE: Checking for internet connection.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Shellam

>> By attempting to connect you will implicitly query DNS (which itself
>> is a connection to server).  
> 
> No it's not - it's putting out a packet targeted at an IP address
> and hoping a server will answer - hence why multi-cast works for
> DNS because you're not directly connecting to a specified server,
> like you do with TCP/IP.  I believe it's similar for ping which is
> why it's used so commonly in monitoring applications.
> 
> > If you're not online you won't be able to
>> resolve the domain name.  
> 
> Exactly - so if all the OP wanted to check for was a working
> Internet connection, then DNS is a better way to go IMHO.

Both at home and at work there are caching DNS on the LAN. So a DNS
request may come back with a valid IP address when the WAN connection is
down. I still won't be able to connect to the remote site.

Bob McConnell

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux