I tried constructing the Hilbert class field of $\Bbb Q(\zeta_{31})$ by imitating one of the problems from MO. I failed miserably as a quadratic field inside the cyclotomic field $\Bbb Q(\zeta_{31})$ has a class number different from $\Bbb Q(\zeta_{31})$. Thanks for your help in advance.
This is a fun question, and I had already been thinking of making some comments on this in the question you link to. Apologies in advance for the long post.
Actually, the quadratic subfield of $\mathbb{Q}(\zeta_{31})$ is $\mathbb{Q}(\sqrt{31})$, and has class number $3$. It is the second quadratic field, with respect to absolute value of discriminant, whose class number is divisible by $3$. However, that's not good enough this time for constructing the Hilbert class field of $\mathbb{Q}(\zeta_{31})$, since the latter has class group that is cyclic of order $9$. Moreover, the argument I gave in the question you link to for disjointness of the Hilbert class field of the quadratic and the cyclotomic field no longer works, because the degree of $\mathbb{Q}(\zeta_{31})$ is divisible by $3$.
First, let us get the second "obstacle" out of the way and give a better proof that the Hilbert class field $H$ of $F=\mathbb{Q}(\sqrt{31})$ is disjoint from $K=\mathbb{Q}(\zeta_{31})$: just by thinking about how the Galois group of $\mathbb{Q}(\sqrt{31})$ acts on elements, and hence on ideals, you will see that it acts by inversion on the class group of $\mathbb{Q}(\sqrt{31})$. The way class field theory works, you can deduce that $H$ is Galois over $\mathbb{Q}$, the subgroup ${\rm Gal}(H/F)\cong \mathbb{Z}/3\mathbb{Z}$ is normal, and the quotient ${\rm Gal}(F/\mathbb{Q})$ acts on it by multiplication by $1$, so that ${\rm Gal}(H/\mathbb{Q})$ is isomorphic to $S_3$. In particular, it is nonabelian, so $H$ cannot be contained in $K$, since its Galois group over $\mathbb{Q}$ is cyclic.
This tells you that the Hilbert class field of $F$, which one can compute to be obtainable by adjoining a root of $x^3+x+1$, gives you a piece of the Hilbert class field of $K$. But because this time the class group of $K$ is cyclic of order $9$, it does not give you everything.
Let $H_2$ denote the Hilbert class field of $K$. Before proceedings, let us think about the structure of $G={\rm Gal}(H_2/\mathbb{Q})$ (the fact that $H_2$ is Galois over $\mathbb{Q}$ again follows from general class field theory yoga). $G$ has a normal subgroup $N={\rm Gal}(H_2/K)$ that is cyclic of order $9$, and the quotient $G/N$ is cyclic of order $30$. First, I claim that this extension splits, so that $G$ is a semidirect product $G\cong \mathbb{Z}/9\mathbb{Z}\rtimes \mathbb{Z}/30\mathbb{Z}$. In the case of $H/\mathbb{Q}$ we could see this simply by observing that the order of the normal subgroup was coprime to its index, and invoking SchurZassenhaus. In the current situation, that argument does not work, so instead we will exhibit a subgroup of $G$ that is cyclic of order $30$ and intersects $N$ trivially. There is a standard trick to this: take inertia at $31$. Let me call it $I$. It must be cyclic of order $30$, because $K$ is totally ramified at $31$ — we are using the fact that $\mathbb{Q}$ has no extensions that are unramified at all finite places — and it intersects $N$ trivially, since $H_2/K$ is everywhere unramified, while the extension cut out by $I$ is totally ramified at $31$.
Having established that $G = N\rtimes I$, we will have the complete structure of $G$ once we know how $I\cong G/N$ acts on $N$ by conjugation, or equivalently how ${\rm Gal}(K/\mathbb{Q})$ acts on the class group of $K$. The automorphism group of $N$ is cyclic of order $6$, and I claim that the image of $G/N$ in that automorphism group is everything. This will determine the whole group, since $G/N$, being cyclic of order $30$, has a unique quotient of order $6$. We already know that multiplication by $1$ is in that image, because of what we said about the Galois group of $H$. Now, if $I\to {\rm Aut}N$ did factor through the quotient of order $2$, then the subgroup of $I$ that is cyclic of order $15$ would act trivially on $N$, and therefore would be normal in all of $G$. Moreover, it is contained (with index $2$) in the inertia subgroup $I$. It follows that its fixed field would be a Galois extension of $\mathbb{Q}$ that is unramified everywhere over $F$, and of degree $9$ over $F$. But wait, we said that $F$ only has class number $3$, not $9$, so this is impossible. It follows that $G/N\to {\rm Aut} N$ does not factor through a quotient of order $2$, but through a quotient of order $6$, i.e. is surjective.
This, finally, gives you a hint on how to find the Hilbert class field of $K$: applying all the same reasoning, we know in advance that the subgroup of $I$ that is cyclic of order $5$ (rather than $15$) will be normal in $G$, and that its fixed field will be an extension that is unramified of degree $9$ over the subfield of $F$ that is fixed by the subgroup of order $5$ inside ${\rm Gal}(F/\mathbb{Q})$. Now that you know in advance that this will succeed, you can fire up the computer and just wait for a few minutes: let $L$ be the subfield of $\mathbb{Q}(\zeta_{31})$ of degree $6$ over $\mathbb{Q}$. Magma will tell you that its class group is cyclic of order $9$ (we already knew this from our group theoretic considerations!) and will, after a few minutes, spit out a slightly horrendous looking polynomial of degree $9$ over $L$ whose root generates the Hilbert class field of $L$: $$ x^9 + \tfrac{1}{256}(351\alpha^4 + 22842\alpha^2 + 999)x^7 + \tfrac{1}{256}(9585\alpha^4 + 33210\alpha^2 + 567)x^6 + \tfrac{1}{256}(56133\alpha^4 + 756702\alpha^2 + 26973)x^5 + \tfrac{1}{128}(14096673\alpha^4  289073286\alpha^2  9985113)x^4 + \tfrac{1}{256}(837980397\alpha^4 + 2627921070\alpha^2 + 89938917)x^3 + \tfrac{1}{64}(525358953\alpha^4 + 150497910738\alpha^2 + 5208850071)x^2 + \tfrac{1}{128}(500734949193\alpha^4  5434147475802\alpha^2  188657086959)x + \tfrac{1}{128}(329428602877167\alpha^4 + 3754393943660730\alpha^2 + 129532294910295), $$ where $\alpha\in L$ has minimal polynomial $$x^6 + 93x^4 + 899x^2 + 31$$ over $\mathbb{Q}$. Its compositum with $K$, obtained by adjoining to $K$ a root of the same polynomial, must then be the Hilbert class field of $K$.
Edit: Franz Lemmermeyer has found a much nicer polynomial that generates the same field over $L$, and therefore the same field over $K$: $$ x^9  x^7  2x^6 + 3x^5 + x^4 + 2x^3  x^2 + x  3. $$

$\begingroup$ That's impressive. Did you try to reduce the defining equation? One could use 'rnfpolredabs' or 'rnfpolredbest' in Pari/GP (there are probably similar commands in Sage or Magma). $\endgroup$ – François Brunault Jan 2 at 7:26

$\begingroup$ @FrançoisBrunault: thank you! I did not try to reduce the equation. If someone does, they should feel free to edit the answer. $\endgroup$ – Alex B. Jan 2 at 11:50

5$\begingroup$ Can Magma verify that this is the same field as the one you get by adjoining a root of $x^9 − x^7 − 2x^6 + 3x^5 + x^4 + 2x^3 − x^2 + x − 3$? $\endgroup$ – Franz Lemmermeyer Jan 2 at 17:23

1$\begingroup$ @AlexB. How we say the class group of K is cyclic? $\endgroup$ – SUNIL PASUPULATI Jan 3 at 5:21

1$\begingroup$ @SunilPasupulati: Magma told me so (I did the computation conditional on GRH). However, the argument does not really depend on that. If the group was $C_3\times C_3$, the entire argument would still work: the extension would be split, and the subgroup of order $5$ in $I$ would still act trivially, so that you could find the Hilbert class field by looking at the sextic subfield of $\mathbb{Q}(\zeta_{31})$. $\endgroup$ – Alex B. Jan 3 at 13:06