In Drosophila, female hydrocarbons are known to be involved in premating isolation between different species and pheromonal races. The role of male-specific hydrocarbon polymorphism is not as well documented. The dominant cuticular hydrocarbon (CHC) in male D. melanogaster is usually 7-tricosene (7-T), with the exception of African populations, in which 7-pentacosene (7-P) is dominant. Here, we took advantage of a population from the Comoro Islands (Com), in which males fell on a continuum of low to high levels of 7-T, to perform temperature selection and selection on CHCs’ profiles. We conducted several experiments on the selected Com males to study the plasticity of their CHCs in response to temperature shift, their role in resistance to desiccation and in sexual selection. We then compared the results obtained for selected lines to those from three common laboratory strains with different and homogenous hydrocarbon profiles: CS, Cot and Tai. Temperature selection modified the CHC profiles of the Com males in few generations of selection. We showed that the 7-P/7-T ratio depends on temperature with generally more 7-P at higher temperatures and observed a relationship between chain length and resistance to desiccation in both temperature- and phenotypically selected Com lines. There was partial sexual isolation between the flies with clear-cut phenotypes within the phenotypically selected lines and the laboratory strains. These results indicate that the dominant male pheromones are under environmental selection and may have played a role in reproductive isolation.