Joint Detection of Malicious Domains and Infected Clients