The focus of many fungal endophyte studies has been how plants benefit from endophyte infection. Few studies have investigated the role of the host plant as an environment in shaping endophyte community diversity and composition. The effects that different attributes of the host plant, that is, host genetic variation, host variation in resistance to the fungal pathogen Ustilago maydis and U. maydis infection, have on the fungal endophyte communities in maize (Zea mays) was examined. The internal transcribed spacer (ITS) region of the rDNA was sequenced to identify fungi and the endophyte communities were compared in six maize lines that varied in their resistance to U. maydis. It was found that host genetic variation, as determined by maize line, had significant effects on species richness, while the interactions between line and U. maydis infection and line and field plot had significant effects on endophyte community composition. However, the effects of maize line were not dependent on whether lines were resistant or susceptible to U. maydis. Almost 3000 clones obtained from 58 plants were sequenced to characterize the maize endophyte community. These results suggest that the endophyte community is shaped by complex interactions and factors, such as inoculum pool and microclimate, may be important.