A dao (MM, p. 143) is described as having the following ability:
Earth Glide. The dao can burrow through nonmagical, unworked earth and stone. While doing so, the dao doesn't disturb the material it moves through.
Dao’s are also described as having innate spellcasting.
Can a Dao cast spells from within the earth (i.e. such as if encountering other burrowing beasts)? Also, can a Dao cast spells from within the earth out into an open chamber?