31

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?

7
  • this might be related
    – lifus
    Feb 4, 2015 at 22:56
  • thank you lifus i tried to find the resolv.config file but i am unable to find it ! I am running boot2docker to use docker since i have a windows system.! Feb 4, 2015 at 23:26
  • yep, it's *nix specific. See this
    – lifus
    Feb 4, 2015 at 23:32
  • Yeah thanks lifus ! I just did that ! its working fine ! :D Feb 4, 2015 at 23:41
  • 5
    @AbhishekPandey Could you self answer your question and explain how you solved your problem for future reference ?
    – Regan
    Jul 23, 2015 at 14:39

5 Answers 5

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

1
  • 1
    Working also with Docker Toolbox on Windows Jun 19, 2019 at 14:19
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.

0
3

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

1
  • in ubuntu: service docker restart
    – jim smith
    Feb 21, 2022 at 16:12
0

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.