This code works for me.
cat /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
ping node.aapanel.com
I got an error message "unable to resolve host address node.aapanel.com" when installing aapanel mail server. I restart postfix, dovcot, etc. Then I reboot the server. After that, I can now use the mail server and can send email.