Query optimizations

There were a few bugs causing DNS queries to make etcd queries that weren't required.