32

I am trying to resolve this network issue which I am facing multiple time while performing any docker commands like "Docker search Ubuntu".
I get an error saying:

"Error response from daemon: server misbehaving.

Can anyone help me on this?

BRap
  • 529
  • 2
  • 10
  • 29
Abhishek Pandey
  • 321
  • 1
  • 3
  • 4

5 Answers5

21

For those who have this problem, it is typically related to having an issue with your DNS being unable to resolve index.docker.io. I had this issue today working from home where my internet connection has a default DNS server that is notoriously flakey.

My dev environment is OSX and I easily solved the issue by changing my DNS servers in network settings to Google's DNS servers (8.8.8.8 and 8.8.4.4) and then restarting my docker host through docker-machine restart MACHINENAME

Ian Belcher
  • 5,583
  • 2
  • 34
  • 43
9

Faster/Easier Solution: login to docker-machine and fix the dns.

Turns out you don't have to go to all the trouble and waiting associated with restarting docker-machine. Just login to the docker machine (i.e. docker-machine ssh default) and edit /etc/resolv.conf - Add the dns settings from your host machine at the top of resolv.conf.

This is more or less what happens when you restart docker-machine and explains why some repositories are unreachable sometimes after you switch networks.

Matt Friedman
  • 1,535
  • 1
  • 17
  • 24
3

I also had the exact same problem. Then I stopped the docker-machine and started it--it worked.

Paba
  • 1,105
  • 3
  • 19
  • 34
1

My issue not solved with stated Answer here.

This is problem with resolving Host... I was getting random error time out and misbehave

You need to enable through a configuration property experimentalHostResolver in %APPDATA%\rancher-desktop\settings.json. By default this property is set to false, meaning that the default DNS process in the rancher desktop will be handled through dnsmasq. However, if this property is set to true the default DNS lookup will switch to host-resolver.

NOTE: This feature can only be enabled for Windows currently and it is an experimental feature

You can take a look at the example settings.json file below as a reference:

   "kubernetes":{
      "experimentalHostResolver":true           <== This is the config!
   },

Reference

Ravi Parekh
  • 5,253
  • 9
  • 46
  • 58
0

Make sure that, when you run this, you are connected to the internet, as Docker needs to be able to do this.

George Ogden
  • 596
  • 9
  • 15