The present invention provides compounds of the formula : (I) wherein: X is O or S; Q1 and Q2 are independently CR5 or N, provided at least one of Q1 and Q2 is N; Y is a direct bond or CH2; R1 is H, optionally substituted alkyl, alkenyl, alkynyl, cycloalkylalkyl, benzyl or oxetan-3-yl-CH2-; R2 is optionally substituted phenyl, pyridine, pyrimidine, pyrazine or pyridazine; R3 is alkyl or haloalkyl; R4 is optionally substituted pyridine, pyrimidine, pyrazine or pyridazine; R5 is H, alkyl, haloalkyl, cycloalkyl, alkoxy, alkoxyC(O)- or (alkoxy) 2CH-; or a salt thereof. The compounds are useful for controlling ectoparasites on animals.