First, DP and MP selection are completely different processes, both are done by the client though.
For MPs, the selection process is random within a forest (because MPs are located using the global catalog) although HTTPS capable MPs are given priority if the client is also HTTPS capable. DNS is never used and neither are boundaries or AD sites or any
other criteria.
I'm not sure what the failover process is honestly for MPs and I don't think it's explicitly documented anywhere.
For DPs, from memory, client will "fail-over" to alternate DP after 8 hours of unsuccessfully trying to contact the first DP chosen in a content location query.
Jason | http://blog.configmgrftw.com