It sounds like Docker has modified your network configuration, possibly by creating network interfaces or changing routing tables, which can sometimes interfere with your default IPv4 settings.
Here are some steps you can try to restore your IPv4 connectivity:
1. Restart Network Manager (Linux): If you’re on Linux, restarting the network manager can often resolve these issues.
sudo systemctl restart NetworkManager
Or, on some systems:
sudo service network-manager restart
2. Disable and Remove Docker Networks: Sometimes Docker's custom networks can interfere. You can prune unused networks:
docker network prune
3. Reset Network Interfaces:
You can try disabling and re-enabling your main network interface. Replace eth0 or wlan0 with your actual interface name.
sudo ip link set eth0 down
sudo ip link set eth0 up
4. Renew DHCP Lease: This will force your system to request a new IPv4 address.
sudo dhclient -r
sudo dhclient
5. Check /etc/resolv.conf:
Docker sometimes overwrites DNS settings. Make sure your /etc/resolv.conf contains valid nameservers, for example:
nameserver 8.8.8.8
nameserver 1.1.1.1
6. Reboot: If all else fails, a full reboot can often reset the network stack.
7. (Optional) Remove Docker Network Interfaces:
If you see interfaces like docker0 or br-xxxxxx and want to remove them:
sudo ip link delete docker0
Summary: Docker can sometimes leave behind network changes. Restarting your network manager, renewing your DHCP lease, and checking your DNS settings usually resolves the issue. If you frequently encounter this, consider updating Docker or reviewing your Docker network settings.
Let me know if you need more specific help for your OS!