The pharyngeal glands of Caenorhabditis elegans are one of five cell types in the pharynx. The transcription factor HLH-6 is required for gland development and function, and is specifically expressed in pharyngeal glands. As a first step to understanding specification of pharyngeal glands, we analyzed the promoter of hlh-6 to identify the elements required for gland-specific expression. Our experiments identified three distinct regulatory elements required for hlh-6 expression: a PHA-4-binding site and two new elements, HRL1 and HRL2 (for hlh-6 regulatory elements 1 and 2). The three elements employ a simple logic for producing cell-type-specific expression: the PHA-4 site restricts expression to the pharynx, HRL2 restricts expression in both a position and lineage-dependent manner, and HRL1 restricts expression to a subset of cell types. In isolation, these three elements have little or no enhancer activity but in combination they produce robust, gland-specific expression. These findings describe a combinatorial code for gland-specific expression and suggest that similar codes may be employed for specification of other pharyngeal cell types.