Let $A$ be a Dedekind domain and let $B:=A[X]/(f(X))$, where $f(X)\in A[X]$ is some monic polynomial such that $B$ is a domain. If I take the canonical map $A\longrightarrow B$, then it nduces a continuos map $\phi\colon \mathsf{Spec} \: B\longrightarrow \mathsf{Spec} \: A$. Now let us consider a maximal ideal $\mathfrak{p}\subset A$ and and let $\mathfrak{q}\in \phi^{-1}(\mathfrak{p})$. My question is:

**Q.** What is a necessary and sufficient condition on $f(X)$ such that the localization  $B_\mathfrak{q}$ is a regular ring?

I just posted, without results, the question on MSE, but maybe this is the most suitable place.