DEV Community

Cover image for boot2docker DNS not working

boot2docker DNS not working

Adam K Dean
Blockchain Lead. Hacker. Founder. Amateur Radio, and all things engineering.
・1 min read

If you're using Docker on OSX, then you'll be using a VM to run your Docker service on, as it needs Linux, not Unix. The most popular of these seems to be boot2docker, though dvm also seems to be quite popular. Other solutions are available.

I have a problem where sometimes boot2docker's DNS just doesn't seem to work.

I found some instructions on how to fix it though:

$ boot2docker ssh
$ sudo udhcpc
udhcpc (v1.22.1) started
Sending discover...
Sending select for
Lease of obtained, lease time 86400
deleting routers
route: SIOCDELRT: No such process
adding dns    
$ sudo /etc/init.d/docker restart
$ exit
Enter fullscreen mode Exit fullscreen mode

Now if you attempt to ping Google, it should work!

Discussion (0)