...
Dnsmasq should not be used by SpamAssassin since it can only forward to other DNS servers.
...
Unbound
Packaging varies slightly between distributions so refer Internet articles for details and current information for your OS version. The default configuration files should give us a desired caching non-forwarding DNS server listening locally only.
...