The present invention provides compounds of the formula : (I) wherein: X is O or S; Q1and Q2are independently CR5or N, provided at least one of Q1and Q2is N; Y is a direct bond or CH2; R1is H, optionally substituted alkyl, alkenyl, alkynyl, cycloalkylalkyl, benzyl or oxetan-3-yl-CH2-; R2is optionally substituted phenyl, pyridine, pyrimidine, pyrazine or pyridazine; R3is alkyl or haloalkyl; R4is optionally substituted pyridine, pyrimidine, pyrazine or pyridazine; R5is H, alkyl, haloalkyl, cycloalkyl, alkoxy, alkoxyC(O)- or (alkoxy) 2CH-; or a salt thereof. The compounds are useful for controlling ectoparasites on animals.