Network structure is a key driver of animal survival, reproductive success, pathogen transmission, and information spread in animal societies. Yet our knowledge of animal social structure is mostly limited to species’ main activity periods. Here, we investigated the role of nocturnal sociality in a wild herbivore population, the rock hyrax (Procavia capensis). Using proximity loggers, we recorded nearly 15,000 encounters over 27 days. We show that hyraxes are choosier regarding their social partners at night. At multiple temporal scales, they maintain their overall network topology while reallocating the weights of social relationships. Our results show that nighttime underground sociality can be an optimal baseline shaping hyrax diurnal interactions above ground. The results also suggest that complex social dynamics are not reserved to species characterized by high cognitive abilities and shed light on the function of nocturnal social interactions in diurnal social species.