I wrote a recent post about managing ALL of your content where I discuss the idea that your content is not just the content on your site.
If you want to check if a domain is valid then something as simple as this might do the trick:
Net::DNS::Resolver.start("google.com").answer.size > 0
But of course, there's much more to it than that. Check it out!