My local sites have seemingly lost the ability to resolve DNS from with Docker. The first signs were when my local sites started running extremely slowly and then I observed error messages being displayed in the control panel, such as:
WP HTTP Error: cURL error 28: Resolving timed out after 10553 milliseconds
After a bunch of debugging and fiddling, I was able to put in a temporary workaround by SSH-ing in and editing the nameserver entry in /etc/resolv.conf file to point directly to my router instead of the default 127.0.0.11 IP address. However, I understand this isn’t a permanent solution and I’d love to understand what could’ve caused this overnight change and how I can fix it properly. I’m running 2.0.6 on macOS Sierra.
Any assistance would be greatly appreciated
Sorry for the trouble!
Try going to Help » Restart Local’s Machine in Local. Sometimes VirtualBox’s network devices can get out of whack and simply restarting the machine will fix it.
I had previously attempted rebooting the entire host machine without success and unfortunately restarting the local VM hasn’t made any difference either.
In that case, this might be worth looking at: https://stackoverflow.com/a/34301566
The path to Local’s Docker Machine is
Here’s another thing you can try:
- Power off
local-by-flywheel in VirtualBox by going to Close » ACPI Shutdown
- Go to Preferences » Network » Host-only networks
- As long as your VMs are using Vagrant or Docker Machine (Local uses Docker Machine), you can safely remove all of the host-only networks
- Re-open Local
So I tried both options and sadly see no change.
Although editing config.json seemed like a promising solution, it’s not made any difference for any of my Local sites.
The only host-only network I have listed was “vboxnet0” - attempted to remove, but it’s regenerated whenever I restart the VM. I tried experimenting with changing the network adapters between NAT, bridged and host-only, but discovered that a host-only and NAT connections are both required in order to start or access the guest instance.
It’s still not obvious to me why this suddenly stopped working and the only functioning workaround is to edit the /etc/resolv.conf file