Digital Ocean recently released private networking support in their NYC2 Data center.
They also published a blog post on how to setup a new droplet with private networking. But one thing the post doesn't do is tell you how to scale your private network for many boxes. One approach is obviously to edit /etc/hosts (but this gets annoying when you add a new box). A better way is to create an internal DNS zone (via the digital ocean web interface) and have your droplets use it:
- Login to digital ocean
- Click "DNS" on the right hand menu
- Click "Add Domain"
- Name it "in.example.com" (obviously use whatever TLD you want).
- Click "Create Domain"
- For each droplet you want resolved by name, add an
A
record with the droplet hostname and private IP.
On each Droplet you create, edit the /etc/resolv.conf
file to contain the following
search in.example.com
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 198.199.120.125
nameserver 141.0.170.89
nameserver 198.199.95.114
Now all of your droplets can ping one another by hostname over the private network. And when you add a new droplet, just add it to the internal DNS zone and it will be visible by other droplets.