This is still slightly broken as it always favors the admin node as master, while things might have changed. I'd rewrite to:
```
      # electing master dns-server
      master = nil
      tnodes.each do |n|
        node = NodeObject.find_node_by_name n
        if node[:dns][:master] 
          master = node
          break
        end
      end
      if master.nil?
        if tnodes.include?(admin[0].name)
          master = admin[0]
        else
          master = NodeObject.find_node_by_name tnodes.shift
        end
      end