For a given finite commutative ring [Formula: see text] with [Formula: see text], one may associate a graph which is called the total graph of [Formula: see text]. This graph has [Formula: see text] as the vertex set and its two distinct vertices [Formula: see text] and [Formula: see text] are adjacent exactly whenever [Formula: see text] is a zero-divisor of [Formula: see text]. In this paper, we give necessary and sufficient conditions for two classes of total graphs to be Cohen–Macaulay.