By default, dnsec-keygen uses /dev/random - the generation is slow, so much more in less busy systems.
One of the alternatives is trying to make the system more busy running more processes in the background. It will be still a bit slow, but less slow. Virtual machines are usually less impacted in entropy when using more I/O.
Other alternative is using /dev/urandom. /dev/urandom is a pseudo-random generator, but unless you are booting the system, should be random enough for your needs.
I advise then to use instead /dev/urandom as source, adding to your command -r /dev/urandom as in:
dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 512 -n HOST {host}
For more, please read:
Bug 1025554 - generating keys using dnssec-keygen is very slow
As ran by @ceph3us after using the -r /dev/urandom parameter,
$ dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 512 -n HOST {host}
keys generation time:
real 0m0.033s
user 0m0.028s
sys 0m0.004s