Skip to content
Alfa Intelli
  • Home
  • About
  • Services
  • Knowledge Base
  • Tools
  • Contact Us
  • Alfa Intelli Tech

How to Resolve the DKIM Test Error: Unexpected Reply Class/Type (-1/-1)

23 January 2025 · SPF & DKIM, Ubuntu

← Knowledge Base

How to Resolve the DKIM Test Error: Unexpected Reply Class/Type (-1/-1)

If you’re setting up DKIM (DomainKeys Identified Mail) for your email server and encounter the error:

opendkim-testkey: ‘default._domainkey.yourdomain.com’ unexpected reply class/type (-1/-1)

don’t worry—this issue is relatively straightforward to fix. In this guide, we’ll walk you through the steps to resolve the error.

Understanding the Error

This error typically occurs because OpenDKIM cannot query the DNS server to retrieve the DKIM key. The issue is often related to incorrect DNS settings or a missing Nameservers directive in the OpenDKIM configuration file.

Steps to Resolve the Issue

1. Update OpenDKIM Configuration

The first step is to update the OpenDKIM configuration file. Follow these steps:

Open the OpenDKIM configuration file in a text editor:

sudo nano /etc/opendkim.conf

Add or update the Nameservers entry with reliable DNS servers.

For example:

Nameservers 1.1.1.1, 1.0.0.1

Save the changes and exit the editor:

Press Ctrl + O to save.

Press Ctrl + X to exit.

2. Restart the OpenDKIM Service

After updating the configuration file, restart the OpenDKIM service to apply the changes:

sudo systemctl restart opendkim

3. Test the DKIM Key

Now, test the DKIM key using the following command:

opendkim-testkey -d your-Domain.com -s default -vvv

Replace your-Domain.com with your actual domain name.

4. Verify the Output

If everything is configured correctly, the output should display:

opendkim-testkey: key OK

This indicates that the DNS query for the DKIM key was successful and the issue is resolved.

Additional Notes

DNS Propagation: If you recently added or updated your DKIM records, ensure sufficient time has passed for DNS propagation. Typically, DNS propagation can take up to 24 hours as per DNS standards to fully propagate across all DNS servers worldwide.

However, in practice, some DNS providers offer much faster propagation. For example:

GoDaddy: In my experience, DNS propagation with GoDaddy is incredibly quick, usually completed within a minute or so.

Cloudflare: Similarly, Cloudflare is known for its lightning-fast propagation, often reflecting changes almost instantly.

If you’re using reliable DNS providers like these, you’re less likely to encounter delays due to propagation. Always verify your changes using tools like MXToolbox or the dig command to ensure your records are live.

Firewall/Network Settings: Verify that your server can query external DNS servers. Firewalls or network restrictions may block DNS queries.

Check Logs: If the issue persists, review the OpenDKIM logs for additional details:

sudo journalctl -u opendkim

By following these steps, you should be able to resolve the DKIM test error and verify your DKIM key successfully. Properly configured DKIM ensures your emails are authenticated and less likely to be marked as spam.

For more tips on email server setup and optimization, explore our other articles!

Tags: DKIM

← Title: Network Tools Plugin – Convert IPv4 to IPv6, Calculate Subnets, and More

Related guides

Install SpamAssassin with Content Filter

5 March 2023Read the guide

Increase Upload File Size Limit with Ubuntu/PHP

28 February 2023Read the guide

Install Roundcube Webmail with Nginx

28 February 2023Read the guide

Need help with your IT?

Let's talk

Contact Us

India

74-81 District Shopping Centre
Sri Ganganagar
Rajasthan - 335001

Australia

241-243 Princes Highway
Corrimal
NSW - 2518

Trading Hours

  • Monday - Friday --- 10 AM to 6 PM (IST)
  • Saturday -- Close
  • Sunday -- Close

© 2026 Alfaintelli Group