Species of Peltigera (lichen-forming Ascomycota) establish obligate symbioses with several monophyletic groups (phylogroups) of Nostoc cyanobacteria. Some of these fungi are strict specialists and only associate with one Nostoc phylogroup throughout their range, while others are generalists and associate with many different Nostoc phylogroups. We sampled 20 Peltigera taxa, mostly representing the Peltigera section Peltigera, from grassland and forest habitats across Europe. Mycobionts’ identities were confirmed using fungal ITS sequences. The Nostoc cyanobionts were identified and grouped based on single nucleotide differences in the trnL region and on the phylogenetic analysis of the rbcLX region. Our data confirmed that some Peltigera species clearly prefer open habitats, while others are largely confined to shady forest habitats. The two habitat preferences are consistently paired with association with different Nostoc groups. As a specific example, two ecologically versatile species, Peltigera canina and P. didactyla, both growing in open and shady habitats, consistently associated with different groups of Nostoc when growing in different habitats. As associations between specific mycobionts and cyanobionts are influenced by habitat conditions, the diversity of both taxon groups should be considered in the context of habitat management and conservation planning.