"Could not resolve host: download.docker.com" while installing docker CE
By forcing curl and apt to use ipv4, download.docker.com
is resolved correctly.in curl, add the -4 argument
Add Docker’s official GPG key:$ curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
then to force apt to use ipv4 => https://www.vultr.com/docs/force-apt-get-to-ipv4-or-ipv6-on-ubuntu-or-debian
It's just a random error (may happens due to instable Internet, DNS caching ...)
In my case just opening "https://download.docker.com/" in my browser (to make sure Internet is working and the docker website is up) resolved the problem
If the problem persists, then change/add your DNS server to google DNS servers : 8.8.8.8,8.8.4.4
You can try the below commands before changing your DNS server :
dig @8.8.8.8 download.docker.com
dig @8.8.4.4 download.docker.com
If you are on ubuntu, then try the below link to change the DNS server :https://askubuntu.com/a/820873/707990