2

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?

SyRenity
  • 3,179
  • 11
  • 57
  • 79

2 Answers2

12

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.

Kevin M
  • 2,312
  • 1
  • 16
  • 21
  • 4
    Could not agree more, hosts via puppet sounds like a world of pain (from the 80's too!) – Chopper3 Jan 04 '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 04 '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 05 '10 at 17:15
3

Syrenity,

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

http://en.wikipedia.org/wiki/Domain_Name_System#History

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. 208.77.188.166) 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.

Rilindo
  • 5,078
  • 5
  • 28
  • 46