Error in Ubuntu server: Server returned error NXDOMAIN

Solution 1:

It's how systemd works : If systemd-resolve tries to resolve a domain that doesn't resolve, it then logs that message, which can just be ignored. There may possibly be other error conditions for issuing this warning.

The NXDOMAIN error will occur when using a non-existent Internet or Intranet domain name. Its name means "Non eXistent Domain". If domain name is unable to be resolved using the DNS, the condition called the NXDOMAIN occurs. For example, calling nslookup with a non-existent name could return the error of Host whatever.com not found: 3(NXDOMAIN).

One case that could cause this problem is when a DNS record is updated on the main authoritative name-server and may take some time to propagate to the recursive DNS servers globally, and this occurs based on the DNS record's Time To Live (TTL).

Another case could be when the server you are trying to reach has gone offline.

In your case, I think the NXDOMAIN error is the symptom, but not the cause of your losing connectivity to the domain. The fact that this condition resolves itself in time, strengthens the theory that it's something to do with your DNS setup. Perhaps clearing the DNS cache on computer and browser might help.

You may observe this error in action on http://cachecheck.opendns.com when entering a non-existent domain name. This tool might help in analyzing the problem.

enter image description here

Solution 2:

I have also faced the above issue, but I have found solutions and fixed

solutions:

sudo unlink /etc/resolv.conf

sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

sudo systemctl restart systemd-resolved

sudo systemctl status systemd-resolved