It seems to me that the answer and the comment are rather imprecise - one also needs to properly define what it means for a set $D \subseteq P$ to be undounded (cofinal) in a chain $L \subseteq P$. For instance, if we define a chain as a liearly ordered subset of a poset, then obviously every $\{p\}$ is a chain, therefore the claim that a set $D$ is cofinal in every chain becomes vacuous. In particular, containing every maximal element of $P$ follows from the condition of being cofinal in every chain.
Let's define the following notion of domination: Let $(P, \leq)$ be a poset, and let $D \subseteq P$, $X \subseteq P$ be subsets of the poset. We will say that $D$ dominates $X$, if: $\forall x \in X \: \exists d \in D \: x \leq d.$
Now the following equivalence holds for any $D \subseteq P$: $D$ is cofinal in $P$ iff $D$ dominates every maximal chain in $P$.
Proof. If $D$ is cofinal, then by definition it dominates every subset of the poset. If $D$ dominates every maximal chain, let $p \in P$. By the Hausdorff Maximal Principle there is a maximal chain $L \ni p$. $D$ dominates $L$, and thus there is $d \in D$ s.t. $p \leq d$. $\Box$
Now a remark: $D$ dominating every maximal chain is equivlaent to the conjunction of the following two conditions: $D$ containing every maximal element of $P$ and $D$ dominating every chain of $P$ without the greatest element and this is probably what the comment and the answer meant.
Further, one cannot replace the definition of domination with a weaker condition (that could be read as: $D$ is unbounded over $X$: $ \forall x \in X \: \exists d \in D \: d \not\leq x.$ For a counterexample define $P = \{(0,n): n \in \omega\} \cup \{(1, \pi)\}$ and let the ordering be given as follows: $(i, j) \leq (k,l) \text{ iff } (i=k \: \wedge j \leq l).$ The set $D:=\{(0,n): n \in \omega\}$ is unbounded over every maximal chain, but it is not cofinal, since there is no element $d \in D$ that would be greater than $(1, \pi)$.
Also, one cannot require the condition of domination to be restricted to $X$ itself (hence the ambiguity of the expression "$D$ is unbounded (cofinal) in a chain"), i .e. we could not say that $D$ dominates $X$ iff: $\forall x \in X \: \exists d \in D \cap X \: x \leq d,$ since then look at the following example: let $ P = \{(0, n): n \in \omega\} \cup \{(1, k): k \in \omega\}$ and define: $(i,n) \leq (j, k) \text{ iff } (i=j=0 \: \wedge n \leq k) \: \vee \: (i Now the set $\{(1, k): k \in \omega\}$ is clearly cofinal in $P$ (and contains all the maximal elements of $P$), but it is not unbounded (cofinal) in every (maximal) chain, since it does not have any element in a maximal chain $L = \{(0,n): n \in \omega)\}$ (also, it obviously dominates every maximal chain).