Solve unbound error about root.key

    

I wrote about running unbound and nsd on OpenBSD 5.6 here .
The other day, the VM that runs those went to DDB. On reboot, I got the following error message :

unbound: [16897:0] error: ldns error while converting string to RR at15: Syntax error, could not parse the RR's type: spamd: \\[priv\\]
unbound: [16897:0] error: failed to load trust anchor from /db/root.key at line 1, skipping
unbound: [16897:0] error: failed to read /db/root.key
unbound: [16897:0] error: error reading auto-trust-anchor-file: /var/unbound/db/root.key

This means “root.key” went broken. To rebuild it, simple run those:

rm /var/unbound/db/root.key
sudo -u _unbound unbound-anchor -a /var/unbound/db/root.key

Et voilĂ , solved!