What are the cons and pros of using hosts files (updated via Puppet for example) vs DNS for data center machines management?

I'm looking to switch from the tedious IP scheme, but concerned about using DNS as it adds another layer of possible failure. And setting redundant DNS just for a dozen of machines doesn't seem right.

On another hand, using hosts file seems more reliable, in case there is a good way to manage it centrally.

Any ideas?


The way to manage hosts file centrally is so important that it was solved long ago. It's called DNS.

Once you get DNS working, you can set it up on several of your servers fairly quickly. Set each one to have another server as it's master, and have each server referencing several servers in /etc/resolv.conf. That way if one goes down, you don't have much failure. The biggest way I see for failure to come about is with a configuration error, but that can happen with hosts files, as well.

  • 4
    Could not agree more, hosts via puppet sounds like a world of pain (from the 80's too!) – Chopper3 Jan 4 '10 at 14:44
  • So the trick for HA setup is to set 2+ DNS servers, and have each one as the master of another? That way single DNS downtime won't affect much, plus if I add any record on one server, it will be propagated to another one? – SyRenity Jan 4 '10 at 17:39
  • I don't have any HA experience under my belt, but that's the way I would do it. A quick google search seems to support this. – Kevin M Jan 5 '10 at 17:15


The reason why DNS came about is because host file management does not scale:


With the older system, each computer on the network retrieved a file called HOSTS.TXT from a computer at SRI (now SRI International).[2][3][4] The HOSTS.TXT file mapped names to numerical addresses. A hosts file still exists on most modern operating systems, either by default or through configuration, and allows users to specify an IP address (eg. to use for a hostname (eg. www.example.net) without checking DNS. Systems based on a hosts file have inherent limitations, because of the obvious requirement that every time a given computer's address changed, every computer that seeks to communicate with it would need an update to its hosts file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.