Problems reaching Forticare servers

How to solve a problem of reaching Forticare servers

When trying to register a Fortigate device to FortiCloud, an error occurs:

Unable to reach FortiCare servers. Please ensure connection before registration

To resolve the issue, configure the following on the Fortigate appliance:

set fortiguard-anycast disable
config system fortiguard
set protocol udp
set port 53
execute update-now