php - Check domain validity with wildcard resolver -
i have site record links user-provided web pages. want record them if valid.
i using checkdnsrr($domain, 'a')
check domain validity, , noticed returning true
. i'm on shared hosting (so can't change anything). reported bug server admin, , replied:
we use opendns our resolvers on servers. resolvers return ip/dns record invalid domains have wildcard set point invalid domains default ip. because of domains enter show having record.
okay then.
i want avoid using curl
on invalid domain waste, there bigger problem. believe resolver returns kind of error page "this domain not exist," , emits 200 or other supposedly valid return status. use status confirm page indeed valid, invalid domain recorded valid site.
(humorously, valid domain invalid url leads page emitting 404 or other error status not recorded).
anyway, there other way check domain validity? don't mind using third party site.
opendns (and others this) return same ip domains should come nxdomain (invalid). if result of check ip, consider invalid. it's 1 check, should valid workaround.
Comments
Post a Comment