Networking with Docker is a pretty hefty topic. One of the interesting things talked about in the book in this area is skydock[1], which provides automatic dns registration inside docker when you start your containers. We've found it very handy for simulating a network of real machines!