Couldn't resolve host name On CentOS

Couldn't resolve host name for http://mirrorlist.centos.org.

Error: Error downloading packages:

 Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]

resolved

vim /etc/resolv.conf

Update:

nameserver 9.9.9.9

nameserver 8.8.8.8

Save this file, then try yum update again.

yum update