We can assume $0\notin D$, or the ring $D^{-1}R$ would be trivial. Also it's not restrictive to assume $1\in D$.
Let $a/b$ be a unit in $D^{-1}R$. Then there exists $c/d\in D^{-1}R$ such that
$$
\frac{a}{b}\cdot\frac{c}{d}=\frac{1}{1}
$$
so
$$
ac=bd
$$
In particular, $ac\in D$, because $b,d\in D$. Thus $a$ divides an element of $D$.
Conversely, suppose $ac\in D$, for some $c\in R$ and let $b\in D$; then
$$
\frac{a}{b}\cdot\frac{bc}{ac}=\frac{abc}{bac}=\frac{1}{1}
$$
Therefore $a/b$ is a unit in $D^{-1}R$. Note that $(bc)/(ac)\in D^{-1}R$ because $ac\in D$.
So we can summarize the facts above in a proposition. For a subset $X$ of $R$ denote by $\hat{X}$ the set
$$
\hat{X}=\{r\in R:rs\in X\text{ for some }s\in R\}
$$
often called the saturation of $X$.
Proposition. An element $a/b\in D^{-1}R$ $(a\in R, b\in D)$ is invertible if and only if $a\in\hat{D}$.
Since $R$ is a UFD, we can say that $D^{-1}$ is the set of elements whose prime factor decomposition contains only primes appearing in the prime factor decomposition of an element of $D$.
Something should be noted more generally. I'll not assume that $R$ is a domain; when writing $a/b$, the hypothesis that $b\in D$ will be implicit.
If $a/b\in D^{-1}R$ is invertible, then $(a/b)(c/d)=1/1$ for some $c/d\in D^{-1}R$. Thus, for some $z\in D$, we have
$$
acz=bdz
$$
so that $a\in\hat{D}$ (same definition as before), because $bdz\in D$.
Conversely, if $a\in\hat{D}$, so $ac\in D$ for some $c\in R$, we have
$$
\frac{a}{b}\cdot\frac{bc}{ac}=\frac{1}{1}
$$
and $a/b$ is invertible for every $b\in D$.
Thus we see that the hypothesis that $R$ is a domain is completely irrelevant.
The saturation of $D$ is closed under multiplication and it's a good exercise in ring of fractions proving that
$$
D^{-1}R\cong\hat{D}^{-1}R
$$
the isomorphism being the obviously defined one. Note that the saturation of $\hat{D}$ is $\hat{D}$ itself.
So if $D$ is saturated (that is, $\hat{D}=D$), then the set of units of $D^{-1}R$ can be described easily as the set of fractions $a/b$ with $a\in D$.
An important case in which $D$ is saturated is when $D=R\setminus P$, when $P$ is a prime ideal of $R$. The proof is very simple.