The X chromosome requires special treatment in the mapping of quantitative trait loci (QTL). However, most QTL mapping methods, and most computer programs for QTL mapping, have focused exclusively on autosomal loci. We describe a method for appropriate treatment of the X chromosome for QTL mapping in experimental crosses. We address the important issue of formulating the null hypothesis of no linkage appropriately. If the X chromosome is treated like an autosome, a sex difference in the phenotype can lead to spurious linkage on the X chromosome. Further, the number of degrees of freedom for the linkage test may be different for the X chromosome than for autosomes, and so an X chromosome-specific significance threshold is required. To address this issue, we propose a general procedure to obtain chromosome-specific significance thresholds that controls the genomewide false positive rate at the desired level. We apply our methods to data on gut length in a large intercross of mice carrying the Sox10Dom mutation, a model of Hirschsprung disease. We identified QTL contributing to variation in gut length on chromosomes 5 and 18. We found suggestive evidence of linkage to the X chromosome, which would be viewed as strong evidence of linkage if the X chromosome was treated as an autosome. Our methods have been implemented in the package R/qtl.