dnd 5e – For the Ranger's natural explorer function, what are the preferred terrains for caves and dungeons classified under?


Side question for mdrichey post: PHB Ranger Natural Explorer: Does the Underdark terrain type mean underground ground? I would like to have a little more detail:

If my character was raised in a dwarf village, in the caves of a mountain, would not his natural explorer function reflect that, allowing him to master the caves and dungeon passages?

For clarity, keep it RAW: Would the caves / dungeons be classified in the type of mountain terrain? If no, what kind of privileged land would they belong to, if any?

I know that dungeons are not always holes in the ground, but for the time, I wonder if that would matter?