Lemma 15.113.2 (Generalized valuation rings). Let $R$ be a nonzero ring. The following are equivalent
For $a, b \in R$ either $a$ divides $b$ or $b$ divides $a$.
Every finitely generated ideal is principal and $R$ is local.
The set of ideals of $R$ are linearly ordered by inclusion.
This holds in particular if $R$ is a valuation ring.
Assume (2) and let $a, b \in R$. Then $(a, b) = (c)$. If $c = 0$, then $a = b = 0$ and $a$ divides $b$. Assume $c \not= 0$. Write $c = ua + vb$ and $a = wc$ and $b = zc$. Then $c(1 - uw - vz) = 0$. Since $R$ is local, this implies that $1 - uw - vz \in \mathfrak m$. Hence either $w$ or $z$ is a unit, so either $a$ divides $b$ or $b$ divides $a$. Thus (2) implies (1).
Assume (1). If $R$ has two maximal ideals $\mathfrak m_ i$ we can choose $a \in \mathfrak m_1$ with $a \not\in \mathfrak m_2$ and $b \in \mathfrak m_2$ with $b \not\in \mathfrak m_1$. Then $a$ does not divide $b$ and $b$ does not divide $a$. Hence $R$ has a unique maximal ideal and is local. It follows easily from condition (1) and induction that every finitely generated ideal is principal. Thus (1) implies (2).
It is straightforward to prove that (1) and (3) are equivalent. The final statement is Algebra, Lemma 10.49.3.