Diatoms possess a silica frustule decorated with unique patterns of nanosize features. Here, we show for the first time from in situ samples that the size of the nanopores present at the surface of the diatom Cocconeis placentula Ehrenb. varies with fluctuating salinity levels. The observed reduction in nanopore size with decreasing salinity agrees with previous laboratory experiments. We also uniquely combined our observations with theoretical considerations to demonstrate that the decrease in the diffusive layer thickness is compensated for by the changes in pore size, which maintain a steady diffusive flux toward the diatom’s cell at different salinities. This process allows diatoms to absorb similar amount of nutrients whatever the salinity and as such to increase their ecological competitiveness in fluctuating environments. These results further suggest that the overall ecological success of diatoms, and their ability to react to environmental changes, may be controlled by the flexibility of the morphological characteristics of their frustules.