Uncovering the direct regulatory targets of doublesex (dsx) and fruitless (fru) is crucial for an understanding of how they regulate sexual development, morphogenesis, differentiation and adult functions (including behavior) in Drosophila melanogaster. Using a modified DamID approach, we identified 650 DSX-binding regions in the genome from which we then extracted an optimal palindromic 13 bp DSX-binding sequence. This sequence is functional in vivo, and the base identity at each position is important for DSX binding in vitro. In addition, this sequence is enriched in the genomes of D. melanogaster (58 copies versus approximately the three expected from random) and in the 11 other sequenced Drosophila species, as well as in some other Dipterans. Twenty-three genes are associated with both an in vivo peak in DSX binding and an optimal DSX-binding sequence, and thus are almost certainly direct DSX targets. The association of these 23 genes with optimum DSX binding sites was used to examine the evolutionary changes occurring in DSX and its targets in insects.