I want to validate that a hostname/IP address is on the public internet; that is, that as far as is reasonable, I'd get the same response from it no matter where I access it from (obviously that's impossible to guarantee.
ie I want to exclude localhost
, 127.0.0.1
, anything in the private IP ranges, and anything that has an invalid TLD.
Am I missing anything else that I ought to be checking?
And is there a better list than http://data.iana.org/TLD/tlds-alpha-by-domain.txt for a list of valid TLDs?