My approach is : Let $L$ be a lattice in $K=\mathbb{Q(\sqrt{d} } )$ . Its dual lattice is $$ L^*=\lbrace \alpha \in K:Tr_{K/\mathbb{Q}}(\alpha L) \subset \mathbb{Z}\rbrace .$$ Now consider the case $d\equiv1(4) .$ Then $K/\mathbb{Q}$ has the basis $\lbrace 1,\frac{1+\sqrt{d}}{2}\rbrace$ . Let $\delta=a+b\frac{1+\sqrt{d}}{2}$ , then $$Tr(\delta\cdot1)=2a \in\mathbb{Z} \ \ and \ \ Tr(\delta\cdot\frac{1+\sqrt{d}}{2})=Tr((a+b)\frac{1+\sqrt{d}}{2}+b(d-1)/4)=\frac{b(d-1)}{2} \in\mathbb{Z} .$$
As dual basis I have $ \lbrace \frac{1}{2},\frac{2}{d-1} \rbrace$ .
I recall thee following general result : if $L=K(x)$ is an extension of number fields of degree $n$, let $f(X)\in K[X]$ be the monic minimal polynomial of $x$ over $K$, $g(X)=f(X)/(X-x)= a_0 + a_1X+...+a_{n-1}X^{n-1}\in L[X]$. Then the dual basis of {$1, x,..., x^{n-1}$} is {$a_0/f'(x),..., a_{n-1}/f'(x)$}. Moreover, if $K=\mathbf Q$ and {$x_i$} is an integral basis of $O_L$, its dual basis is a $\mathbf Z$-basis of ${O_L}^*$ . See e.g. D. Marcus, "Number Fields", chap.3, ex.35 and 39. This can be applied immediately to your two examples of quadratic fields (here and in a previous post).