vincevincevince
asked on
How to check if a domain is live even if PING is blocked?
I have been using PING to check if a domain is live, however, some domains, depsite being available on port 80, are blocking PING.
$response=shell_exec("ping $site -n -c 1 -w 2 -W 2");
I want a fast way of testing port 80, if it is live or not. This must be an automated solution as it needs to be part of a script.
$response=shell_exec("ping
I want a fast way of testing port 80, if it is live or not. This must be an automated solution as it needs to be part of a script.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Barry, that is just perfect, thanks :-)
You really deserve the points, I wish I had more to give
You really deserve the points, I wish I had more to give
would this work? (needs netcat installed):
printf "GET / HTTP/1.0\n\n" | nc -w $timout $host $port | perl -pe 'if(m|^HTTP/1\.1 200 OK|) { print "OK\n"; } else { print "NOPE\n";} exit(1);'
best,
philipp