Configure ubuntu on digitalocean so that URL of main domain without www in front can work [closed]

I have a Ubuntu 20.04.3 LTS virtual machine running nginx/1.18.0 on DigitalOcean.

Currently, when I key in the URL, it works. However, when I key in the URL, I get the following error;

This site can’t be reached.’s server IP address could not be found.

I am not sure whether this is a DNS or nginx problem.

How can I configure the digitalocean Ubuntu VM such that the URL without the www in front works?