Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a lot of documentation I've seen recently, servers are referred to by internal hostnames, such as production-1, production-2, db-1. I realize I can associate these names in the hosts file on the server, but this would obviously mean maintaining a host file for multiple servers, which for anything greater than 2 or 3 would get unwieldy.

Is there some simple way people manage common hostnames across multiple servers and keep them in sync, without having to edit multiple files every time?

share|improve this question

closed as not a real question by gravyface, mdpc, HopelessN00b, Wesley, Michael Hampton Sep 1 '12 at 6:48

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I'm not sure what you're asking... is the answer "use a DNS server?" – HopelessN00b Aug 31 '12 at 17:53
DNS, NetBIOS, WINS, plenty of options. Would help immensely if you could tell us if you're running a domain (Windows/*NIX), etc. – gravyface Aug 31 '12 at 17:54
All of my servers are running Ubuntu 12.04. – Dan Aug 31 '12 at 17:58
@Dan That's... well, that doesn't really help clarify what you're asking, though. – HopelessN00b Aug 31 '12 at 18:03
The question is tagged as DNS. He's just surprised it's even a question because that's the answer. (I'm guessing, any way.) – Aaron Copley Aug 31 '12 at 18:34
up vote 4 down vote accepted

You'll want a DNS server. DNSMasq is quite easy to use and is in the apt repository on Ubuntu (apt-get install dnsmasq) and believe it's an option during the install you can check off.

It will also do DHCP and will append hostnames to your DNS suffix (i.e. yourcompany.local or whatever) when leases are obtained, so helpful for workstations too.

Obviously you'll need to set all your servers/machines on your network to use the IP of the server you choose to run DNSMasq. It started life as a caching DNS forwarder, and does a very good job of that, but you can do things like use the server directive to specify forwarders for specific domains (i.e. if you have a corporate DNS server that's authoritative for some other domain i.e. for resolving requests over VPN, etc.).

You also need to specify upstream DNS servers: Google Public DNS (, OpenDNS (, your ISP's DNS servers, or perhaps your router; basically whatever you use now is likely fine.

The docs and dnsmasq.conf are quite easy to follow; should be fairly straightforward to setup.

share|improve this answer
Thanks a ton. This is definitely what I needed :-) – Dan Aug 31 '12 at 18:43

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