After upgrading your fedora host ( in my case it was fedora 32) are you facing issues while building docker containers which says “Could not resolve host ….” ? I ran into the same error.
For ex:curl command in the docker container was failing:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0curl: (6) Could not resolve host: storage.googleapis.com
dnf install in the docker container build was failing:
CentOS-8 - AppStream 0.0 B/s | 0 B 01:00
Errors during downloading metadata for repository 'AppStream':
- Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=container [Could not resolve host: mirrorlist.centos.org]
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=container [Could not resolve host: mirrorlist.centos.org]
I got it resolved after executing below steps:
Find out your wlan interface
#ip addr show |grep wlp
3: wlp0s20f3:
inet 192.168.68.102/24 brd 192.168.68.255 scope global dynamic noprefixroute wlp0s20f3
Then: enable masquerade on this intereface:
#sudo firewall-cmd --get-zone-of-interface=wlp0s20f3
#sudo firewall-cmd --zone=FedoraWorkstation --add-masquerade --permanent
#sudo firewall-cmd --reload
Once you enabled masquerade on the interface, restart docker service.
#sudo systemctl restart docker
Now try to build your container again!
Ref# http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/