The gut microbiota plays an important role in animals’ survival in their local environments. The intertidal rocky shore is a key interface of oceanic, atmospheric and terrestrial environments, and the transmission modes of microbes between an intertidal host and the environment are complex and largely ignored. In the present study, we characterized the gut microbiota of the intertidal snail Nerita yoldii, which is experiencing a northward range shift under the combined impacts of climate change and anthropogenic seascape transformation, and also determined the nearby environmental microbiota on the rock and in the seawater at five locations along the snail's distribution range in China. The gut microbial communities were significantly different from the environmental microbial communities, and the dominant phyla were Tenericutes, Cyanobacteria and Bacteroidetes, and Proteobacteria in the gut, rock and seawater microbial communities, respectively. At the genus level, Mycoplasma, with a relative abundance of 48.0 ± 10.2%, was the dominant genus in the gut microbial community, however, the relative abundances of this genus on the rock and in the water were low. These results imply that the gut microbial community of the intertidal snail N. yoldii is relatively independent from the environmental microbial community, and the dominant genus Mycoplasma in the gut, that is rare in the environment, can potentially assist the snail living in the harsh intertidal environment, especially at its northernmost distribution range edge.