Verify if an URL exist

How can I know if an givel URL really exists?

My users add URLs, but I have to validade that they exists, like a ping
to the URL.

open-uri...