When we first released it, weaveDNS was a bit forgetful — if you stopped and started it, it would lose its database of names. It would also (probably) be given a fresh IP address by the docker daemon, so containers which had been told its old address would no longer be able to reach it.

Happily, we’ve since fixed those two problems. Firstly, weaveDNS is given a complete list of names when it’s launched, so it doesn’t matter if you restart it. Secondly, it now binds to the IP address of the Docker bridge device, which won’t change when the container is restarted.

The combined effect of these improvements is that it doesn’t matter if weaveDNS is running when you start a container: you can start it later, and still be able to resolve names.

However, previously a container would be told to use weaveDNS if and only if weaveDNS was running at the time, which doesn’t make sense any more. So we have made this opt-in explicit, with the argument --with-dns to weave run meaning “use weaveDNS as the name server for this container”. As before, giving a container a hostname ending in .weave.local makes it resolvable at that name.

Lastly, the fate of weaveDNS is no longer tied to that of weave. It now has its own command to stop it: weave stop-dns.

To summarise:

sudo weave launch
sudo weave run -tid -h pong.weave.local ubuntu
sudo weave launch-dns
docker attach $(sudo weave run --with-dns -tid ubuntu)
# ping pong.weave.local
sudo weave stop-dns