Functions as a stress-inducible and DNA-binding transcription factor, playing a central role in the transcriptional activation of the heat shock response (HSR), leading to the expression of a large class of molecular chaperones, heat shock proteins (HSPs), that protect cells from cellular insults' damage (PubMed:29042483, PubMed:15611166, PubMed:22265419). Upon exposure to heat and other stress stimuli, activates gene transcription through binding to site-specific heat shock elements (HSEs) present in the promoter regions of target genes, such as the HSPs (PubMed:29042483, PubMed:27688402, PubMed:15611166, PubMed:22265419). Binds to inverted 5'-NGAAN-3' pentamer DNA sequences in HSEs (PubMed:29042483, PubMed:27688402). Involved in positive modulation of expression of heat shock protein hsp-16.2 in response to heat shock; may act in concert with homeodomain-interacting protein kinase hpk-1 (PubMed:15611166, PubMed:28198373, PubMed:29036198). In response to heat shock or starvation, required for the modulation of lifespan, and protection against aberrant protein aggregation proteotoxicity; may act in parallel with the Insulin/IGF-1-like signaling (IIS) mediated pathway (PubMed:15611166, PubMed:18331616, PubMed:28198373, PubMed:29036198). Plays a role in modulating autophagy, in response to a moderate and short-term heat shock, also known as a hormetic heat shock (PubMed:28198373). Involved in positive modulation of ascaroside pheromone biosynthesis in response to heat shock, perhaps by directly activating transcription of peroxisomal fatty acid beta-oxidation genes (PubMed:26759377). Required in modulating the response to infection by either Gram-negative or Gram-positive bacteria, perhaps acting via regulation of expression of Hsp90/daf-21 and members of the small heat shock protein (HSP20) family (PubMed:16916933, PubMed:29042483). May play a role downstream of the daf-16/FOXO and daf-2 signaling pathway in response to bacterial pathogens (PubMed:16916933). Modulates expression of multiple microRNA genes, in both heat shock-dependent and -independent manner (PubMed:28837599). Independent of heat shock, required to modulate expression of genes involved in larval development, mainly distinct from HSPs; acts in concert with putative transcription factor efl-1/E2F, which may form part of a multiprotein DRM complex (PubMed:15611166, PubMed:27688402). Independent of heat shock, involved in promoting death of the linker cell, a male-specific cell which guides the elongation of the gonad; perhaps acting by modulating expression of ubiquitin-conjugating enzyme let-70 (PubMed:26952214). Plays a role in egg-laying (PubMed:15611166). Forms homodimers and homotrimers (PubMed:29042483, PubMed:22265419). Component of the DHIC (ddl-1-containing hsf-1 inhibitory complex), which contains at least ddl-1, ddl-2, hsb-1 and hsf-1 (PubMed:22265419). Within the complex, interacts with ddl-1 (PubMed:22265419). Formation of the DHIC may be dependent upon the Insulin/IGF-1-like signaling (IIS) mediated pathway (PubMed:22265419). Localizes constitutively to the nucleus (PubMed:23107491, PubMed:29042483). Localization to the nucleus enhanced by heat shock (PubMed:22265419). Localization to nucleus inhibited by the Insulin/IGF-1-like signaling (IIS) mediated pathway (PubMed:22265419). In response to heat shock, forms nuclear stress granules (PubMed:23107491, PubMed:29036198). These structures are dependent upon either heat shock, or can be induced by treatment with sodium azide, which may act by inhibiting ATP production (PubMed:23107491). DNA binding may promote localization to stress granules (PubMed:23107491). Localization to stress granules partially overlaps with sites of active transcription (PubMed:23107491). Other stressors such as osmotic stress, heavy metals, or ethanol do not induce localization to nuclear stress granules (PubMed:23107491). Expressed in intestinal cells, body wall muscle cells, and hypodermal cells, as well as many neurons in the head and tail. Induced by heat shock. Phosphorylated. Sumoylated (PubMed:29036198). Sumoylation may inhibit transcriptional activity in response to heat shock (PubMed:29036198). RNAi-mediated knockdown increases susceptibility to Gram-negative bacterium P.aeruginosa in wild-type and in a daf-2 mutant background (PubMed:16916933). Abolishes both median and maximum lifespan extension caused by starvation (PubMed:18331616). Fails to prevent paralysis due to proteotoxicity under starvation conditions (PubMed:18331616). Prevents the heat shock-induced increase in lgg-1/Atg8 punctae in body-wall muscles, nerve ring neurons and proximal intestinal cells (PubMed:28198373). Accelerates death upon exposure to the Gram-negative bacterium P.aeruginosa PA14 (PubMed:29042483). Belongs to the HSF family.