Zeroconf announcing my Docker containers

Whilst writing a blog yesterday on Docker, the way I address my Docker containers on my system was by putting 172.17.0.1 into my /etc/hosts which seems kindof crazy.

Ideally my named container “foobar”, would appear as “foobar.local” on my LAN.

How can I achieve nicely named container for DNS resolution? I know systemd mymachines in /etc/nsswitch.conf achieves this for its containers, but how does Docker achieve similar functionality?

I’m aware of --link but that’s between Docker containers IIUC.

Thank you!