A strongly connected digraph is called a cactoid-type, if each of its blocks is a digraph consisting of finitely many oriented cycles, sharing a common directed path. In this article, we find the formula for the determinant of the distance matrix for weighted cactoid-type digraphs and find its inverse, whenever it exists. We also compute the determinant of the distance matrix for a class of unweighted and undirected graphs consisting of finitely many cycles, sharing a common path.