Software⏱️ 3 min read📅 2026-06-11

How to Fix: Error in Ubuntu server: Server returned error NXDOMAIN

Error in Ubuntu server: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.

Quick Answer: Check the DNS settings on your server and ensure that the domain name is correctly configured. You can try updating the resolv.conf file or using a different DNS service.

Error in Ubuntu server: Server returned error NXDOMAIN. This issue affects users who are unable to reach their Ubuntu server from outside its internal LAN, but can access it after a few minutes.

This error is frustrating because it prevents users from accessing their server without having to wait for an extended period of time. The solution involves identifying and resolving the DNS issues that are causing this problem.

🛑 Root Causes of the Error

  • The primary reason for this error is a DNS lookup failure. When a client attempts to resolve a hostname to an IP address, the DNS server returns an NXDOMAIN (no such domain) error if it cannot find the requested domain. In this case, the issue is caused by a misconfigured or non-existent DNS entry for the server's hostname.
  • An alternative reason could be a temporary DNS cache expiration, where the DNS resolver caches the IP address of the server temporarily, but then loses the cached value due to an expired timeout.

🚀 How to Resolve This Issue

Update and refresh DNS records

  1. Step 1: Run `dig +short ` to check if the DNS entry for the server's hostname is correct. If it's not, update the DNS record using your DNS provider's management interface or a tool like `host`.
  2. Step 2: Use `systemctl restart systemd-resolved` and `systemd-resolve --flushcache` to reload and flush the DNS resolver cache. This will ensure that any cached DNS entries are updated and removed.
  3. Step 3: Verify that the DNS entry is correct using `dig +short ` again.

Check for temporary DNS cache expiration

  1. Step 1: Run `systemctl restart systemd-resolved` to reload the DNS resolver cache. This will ensure that any cached DNS entries are updated and removed.
  2. Step 2: Use `dig +short ` to check if the DNS entry for the server's hostname is correct. If it's not, update the DNS record using your DNS provider's management interface or a tool like `host`.

🎯 Final Words

To resolve the error in Ubuntu server: Server returned error NXDOMAIN, follow one of the above methods. Update and refresh DNS records by running `dig +short `, `systemctl restart systemd-resolved`, and `systemd-resolve --flushcache`. Alternatively, check for temporary DNS cache expiration by reloading the resolver cache with `systemctl restart systemd-resolved` and verifying the DNS entry using `dig +short `.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions