The dun gene is a dilution gene that affects both red and black pigments in the coat color of a horse. The dun gene lightens most of the body while leaving the mane, tail, legs, and primitive markings the shade of the undiluted base coat color. A dun horse always has a dark dorsal stripe down the middle of its back, usually has a darker face and legs, and may have transverse striping across the shoulders or horizontal striping on the back of the forelegs. Body color depends on the underlying coat color genetics. A classic "bay dun" is a gray-gold or tan, characterized by a body color ranging from sandy yellow to reddish brown. Duns with a chestnut base may appear a light tan shade, and those with black base coloration are a steel gray. Manes, tails, primitive markings, and other dark areas are usually the shade of the undiluted base coat color. The dun gene may interact with all other coat color alleles.
Dun is believed to be the ancestral or wild type color of horses. Many equines appearing in prehistoric cave paintings such as in Chauvet Cave are dun, and several closely related species in the genus Equus show dun characteristics. These include the Przewalski's horse, onager, kiang, African wild ass, an extinct subspecies of plains zebra, the quagga, and an extinct subspecies of horse, the tarpan. Zebras can also be considered a variant of dun where the dilution is so extreme it turns the hair nearly white, and the primitive markings (like the striped leg barring) extend across the entire body.
Neither the non-dun1 nor the non-dun2 mutations were found in any other equids.
Dun visibly affects all the three base colors, bay (bay, classic, or zebra dun), black (mouse dun or grullo), and Chestnut (red dun). It is more difficult to recognize when combined with other dilution genes or if affected by gray. Shades include:
- Dun, also called bay dun, classic dun, or zebra dun is the most common type of dun, and has a tan or gold body with black mane, tail, and primitive markings. Genetically, the horse has an underlying bay coat color, acted upon by the dun gene.
- Red dun, also called claybank, is a light tan coat with reddish instead of black points and primitive markings. Genetically, the horse has an underlying chestnut coat color, acted upon by the dun gene. Thus, as there is no black on the horse to be affected, the undiluted underlying color is red.
- Grullo or grulla, also called blue dun or mouse dun, is a smoky, blue-gray to mouse-brown color and can vary from light to dark. They consistently have black points and they often have a dark or black head. The primitive markings are usually all black. Genetically, the horse has an underlying black coat color, acted upon by the dun gene.
- Dorsal stripe down the center of the back, along the spine, seen almost universally on duns
- Horizontal striping on the back of forelegs, common on most duns, although at times, rather faint
- Facial mask, a darker area around the nasal bone and forehead, sometimes making the head close to the undiluted color, some patterns colloquially called "Cobwebbing."
- Transverse stripe, a crosswise stripe along the shoulders perpendicular to the dorsal stripe, very common in donkeys, less common in horses, and if present, often faint, usually only visible on a short summer coat, if at all. 
- Frosting: light hairs found on either side of the mane and on both sides of the dock of the tail.
Other variations result from the interplay of additional genes:
- Chestnut + dun + cream gene (single copy) = "dunalino" or "palomino dun"
- Bay + dun + cream gene (single copy) = "dunskin" or "buckskin dun"
A single copy of the cream gene on a black base coat does not significantly lighten black hair, though it may have a subtle effect, and thus a single copy generally has no visible effect on a grullo, either. Conversely, double copies of the cream gene create very light-colored horses (cremello, perlino, and smoky cream). Thus, if a horse with two cream dilution alleles also carries the dun gene, it also will be cream-colored, with primitive markings not visible to any significant degree.
Dorsal striping alone does not guarantee the horse carries the dun gene. There two types of non-dun, called non-dun1 and non-dun2. Non-dun1 horses have no dun color dilution, but may keep primitive markings, while non-dun2 horses have neither the dun color dilution nor primitive markings. Non-dun1 heterozygous with non-dun2 may not produce primitive markings, or may be the mechanism that produces faint dorsal striping, or countershading.
The Fjord horse breed, which is predominantly dun, uses unique Norwegian-based terminology to distinguish between the different shades of dun horses. "Brown dun," or brunnblakk is a zebra dun, rødblakk is a red dun, grå - literally "gray" - is a grullo, buckskin duns are called ulsblakk or white dun, and a dunalino (dun + palomino) is called a "yellow dun" or gulblakk. A cremello, perlino or smoky cream is called "white" or kvit.
Historically, before modern genetic studies distinguished between alleles, diluted colors were sometimes lumped together and simply called "dun".
The dun gene, when on a "bay dun" horse, can closely resemble buckskin, in that both colors feature a light-colored coat with a dark mane and tail. In particular, buckskins with non-dun 1 primitive markings can easily be confused with dun.: 32 Genetically, a bay dun is a bay horse with the dun gene. A buckskin is bay horse with the addition of the cream gene, causing the coat color to be diluted from red to gold, usually without primitive markings. Visually, a bay dun is a tan-gold color, somewhat darker and less vivid than the more cream or gold buckskin, and duns always possess primitive markings.  Today, pedigree analysis, DNA testing, studying possible offspring, and the vividness of primitive markings are used to determine whether a horse is a dun.
A red dun may also be confused with a perlino, which is genetically a bay horse with two copies of the cream gene, which creates a horse with a cream-colored body but a reddish mane and tail. However, perlinos usually are significantly lighter than a red dun and have blue eyes.
Grullos are sometimes confused with roans or grays. However, unlike blue roan, dun has no intermingled black and white hairs, and unlike a true gray, which also intermingles light and dark hairs, the color does not change to a lighter shade as the horse ages. With a dun, the hair color itself is one solid shade and remains so for life.
To further confuse matters, it is possible for a horse to carry both dun and cream dilution genes; such horses with golden buckskin coloring and a complete set of primitive markings are referred to as a "buckskin dun" or a "dunskin". On such horses, the light-shaded primitive markings are most noticeable during the summer months, when the winter hair sheds. A palomino that also carries dun, showing primitive dorsal striping or leg bars indicative of a red dun may be called a “dunalino.”
Countershading of nd1may be harder to differentiate between a dorsal stripe on light-colored horses such as red duns.
There are three known alleles of the dun gene: dun (D), non-dun1 (d1), and non-dun2 (d2). Dun is dominant, so the phenotype of a horse with either one or two copies of the gene is dun. In effect, two non-dun parents cannot produce a dun foal. Horses that are non-dun1 d1/d1 or d1/d2 may have some asymmetry in pigment distribution, producing primitive markings, but to a lesser degree than dun horses. Homozygous non-dun1/non-dun1 horses typically have clearer primitive markings than heterozygous d1/d2 horses. The primitive markings from non-dun1 are more visible on a bay or chestnut horse; they blend in on a black. A horse with two copies of non-dun2 lacks primitive markings.
Dun has a stronger effect than other dilution genes in that it acts on any coat color. In contrast, the silver dapple gene acts only on black-based coats, and the cream gene is an incomplete dominant which must be homozygous to be fully expressed, and when heterozygous is only visible on bay and chestnut coats, and then to a lesser degree.
The dun dilution effect is caused by pigment only being placed in a part of each hair. Specifically, hairs from diluted areas only have pigment along one side of them, while hairs from darker parts such as the dorsal stripe have pigment all the way around.
Genetic analysis and DNA sequencing results published in 2015 link dun color to the T-box 3 (TBX3) transcription factor. When functional, it creates dun coloring, including the primitive markings, and when recessive, a horse is not dun. In humans and lab mice, TBX3 is critical to development. Abnormalities are linked to a collection of developmental defects called ulnar–mammary syndrome, and the null allele (being unable to produce any TBX3 at all) is thought to be embryonic lethal. In non-dun horses, the TBX3 protein is still functional, and is still produced in most cells, but not expressed in the hair cortex. Where the coat is diluted, the color is not uniform throughout each hair, but rather is more intense on the outward-facing side of the hair shaft and lighter underneath. In the darker areas, where the primitive markings occur, the hair shaft is of uniform color. One of the researchers involved in the study said it could be called a "microscopic spotting pattern".: This phenomenon is new to science and has not been observed in rodents, primates, or carnivores.
There are two forms of non-dun color, non-dun1 and non-dun2, caused by different mutations. Non-dun1 horses have some primitive markings, while non-dun2 horses do not.
Prior to domestication of the horse, dun, non-dun1, and the leopard complex are thought to have been the wild type modifiers of the base colors bay and black for wild horses. It is thought that the non-dun2 genetic mutation (as well as the development of chestnut base color) occurred after domestication. Ancient DNA from a horse that lived about 43,000 years ago, long before horses were domesticated, carried both dun and non-dun1 genes.
The non-dun mutations appear to "disrupt the function of a transcriptional enhancer regulating TBX3 expression in a specific subset of hair bulb keratinocytes during hair growth." The region deleted in non-dun2 is predicted to include binding sites for the transcription factors ALX4 and MSX2, which are both known to be involved in hair follicle development. TBX3 was significantly downregulated in non-dun horses compared to dun horses, while the neighboring gene, TBX5, was expressed in about the same amount. In dun horses, the pattern of TBX3 expression mirrored the pattern of pigment deposition in the hair, that is, TBX3 was found wherever the pigment was not. TBX3 was not found in the hair cortex keratinocytes from non-dun horses, nor in those from the dorsal stripe of dun horses. However, all of the horses had a thin outer layer of the hair where TBX3 was expressed. Two markers of mature melanocytes, KIT and MITF, were found only in the pigmented areas of the hair. This indicates that the hair follicles of dun and non-dun horses have different distributions of pigment producing cells. KITLG encodes KIT ligand, a molecule required for melanocyte migration and survival in the skin and hair follicle. Keratinocytes expressing KITLG were found all the way around the hair in non-dun horses, but only on the pigmented side in dun horses. The region where KITLG was not expressed was similar to, but not exactly the same as, the region where TBX3 was expressed. TBX3 is not thought to directly affect KITLG expression.
Both non-dun1 and non-dun2 are found in a region of equine chromosome 8 whose only gene is TBX3. Non-dun1 has a guanine where dun has an adenine at chromosome 8 base pair 18,226,905, which appears to be sufficient to cause non-dun1 coloration. In addition, non-dun1 has another single nucleotide polymorphism compared to the version of dun that is most common in domestic horses, where a guanine in dun is replaced with thymine in non-dun1 at chr. 8: 18,227,267. However, that SNP was also found in some dun Estonian native horses, so is not necessary for dun. Non-dun2 has a 1,609 bp deletion and another very near 8 bp deletion. Comparison with TBX3 in other species showed that the non-dun2 deletion is a more derived allele. Nucleotide diversity across the flanking regions of chromosome 8 for the various alleles indicates that the non-dun2 mutation most likely occurred on a chromosome that already had non-dun1.
- "Dun Dilution - Direct Test". Veterinary Genetics Lab, University of California, Davis. Retrieved 2019-04-27.
- Pruvost M, et al. (2011-11-07). "Genotypes of predomestic horses match phenotypes painted in Paleolithic works of cave art". PNAS. 108 (46): 18626–30. Bibcode:2011PNAS..10818626P. doi:10.1073/pnas.1108982108. PMC 3219153. PMID 22065780.
- "Przewalski's horse". Smithsonian's National Zoo. 25 April 2016. Retrieved 2019-04-26.
- Imsland F, McGowan K, Rubin CJ, Henegar C, Sundström E, Berglund J, et al. (February 2016). "Regulatory mutations in TBX3 disrupt asymmetric hair pigmentation that underlies Dun camouflage color in horses". Nature Genetics. 48 (2): 152–8. doi:10.1038/ng.3475. PMC 4731265. PMID 26691985. Lay summary – Science Daily.
- "Dun Zygosity Test." Veterinary Genetics Lab, University of California, Davis. Web page accessed December 4, 2009
- "Introduction to Coat Color Genetics". UC Davis. Retrieved 2019-04-27.
- Adalsteinsson S. (May 1978). "Inheritance of yellow dun and blue dun in the Icelandic toelter horse". J Hered. 69 (3): 146–8. doi:10.1093/oxfordjournals.jhered.a108913. PMID 731005.
- Cream - Horse Coat Color
- "More about Dun and Primitive Markings". Etalon Diagnostics. Retrieved 2019-04-28.
- "Dun". CAG - Center for Animal Genetics. Retrieved 30 April 2020.
- Sponenberg, Phillip. "Color in Fjord Horses". Norwegian Fjord Horse Registry. Retrieved January 20, 2010.
- Imsland, Freyja (2015). Monogenic Traits Associated with Structural Variants in Chicken and Horse (PDF) (Thesis). Uppsala. p. 42. ISBN 978-91-554-9295-3. ISSN 1651-6206.
- "A Horse Of A Different Color: Buckskins And Duns". Cowgirl Magazine. 15 August 2017. Retrieved 2019-04-28.
- Frank DU, Emechebe U, Thomas KR, Moon AM (2013-07-02). Dettman R (ed.). "Mouse TBX3 mutants suggest novel molecular mechanisms for Ulnar-mammary syndrome". PLOS ONE. 8 (7): e67841. Bibcode:2013PLoSO...867841F. doi:10.1371/journal.pone.0067841. PMC 3699485. PMID 23844108.
- Waara, Anneli (December 21, 2015). "Genetics of camouflage and the Dun pattern in horses". SciLifeLab, Uppsala University. Retrieved June 26, 2016.
- Media related to Dun gene of the horse at Wikimedia Commons