0

I understand that this is a server-fault question, and I will most likely close this after it's answered. But I really need this answer now, and since it's Halloween, serverfault has very few people on there! I really appreciate it everyone.

Can someone tell me if I am doing this right?

I have 2 projects (dragon and falcon). I am setting up the servers like this. But, I am not using "DNS". It's just hostnames.

main.admin (controls all servers)

dragon.admin (SVN repository)
dragon.db1 (database)
dragon.db2

falcon.admin
falcon.db1
falcon.db2
falcon.web
falcon.cache

Will I need "DNS" service? Or, can I do it like this...through hostnames?

Happy Halloween everyone!

2
  • Knowing that what you're doing is wrong, and doing it anyway, is sociopathic behavior. It's only a short step from there to becoming a serial killer :-)
    – user12022
    Nov 1, 2009 at 6:13
  • Yes, that's why I voted to close my own question ;)
    – Alex
    Nov 1, 2009 at 11:01

4 Answers 4

4

Hmnn..

First off, are you sure you don't already have DNS?

  • If your PC is connected to an Active Directory Domain Controller, then you already have local DNS.
  • If you have a cheap Linux-based wireless router / firewall connecting your LAN to the Internet, then there is a fair chance it can provide local DNS for you.

So before we can help you more explicitly, we'll need to know what your network setup and client and server software looks like.

Second, I'm not sure about the "controls all servers" part, and the mapping of both project name and service name to a single hostname. What are you trying to accomplish?

A very common solution would be to:

  • Give every machine a machine specific hostname for life, unrelated to its functions (ex. SRV001, ELVIS, HYDROGEN, etc).
  • Create CNAMES mapping network level services to machines (ex. DB01 points to SRV014).
  • Create application-specific configuration files that tell each application (project) which resources to use by their service names (ex. "Falcon" knows from its config file that it should use DB03 and DB04).

Regarding what naming convention to use ... well, any convention that makes sense to you and your colleagues. In other words it is quite domain-specific. Here is the most upvoted thread on this site regarding server names. Regarding service name, I would propose to let go of old habits, and use some ASCII characters, they are not an endangered species... So DATABASE_01 is neater to my eyes than DB01. Another good option is subdomains, i.e. "a.database.server.localdomain", "b.database.server.localdomain" and so forth.

Will I need "DNS" service? Or, can I do it like this...through hostnames?

You will not need DNS, it's simply a better solution which is far easier to manage when you have more than a handful computers. Actually, in the very first days of the Internet, DNS did not exists, the Internet ran entirely on host files. You should not use "." as a separator, it is reserved -- use dashes or possibly underscores, like "falcon-admin".

1
  • +1 for the link to the cool server name question. I thought the same thing!
    – tomjedrz
    Nov 1, 2009 at 23:07
2

You don't need DNS if the following is true:

  1. You control every computer that will talk to these services.
  2. You don't mind keeping the appropriate hosts file in sync if anything changes.

I suggest you at some point go back and set up DNS, but you don't need it to get going. Just add appropriate entries to the platform-specific hosts files.

7
  • Great. Is my naming convention correct?
    – Alex
    Nov 1, 2009 at 4:55
  • Alex's previous question was about administering the hosts file to all involved hosts. 2+ hosts == time to use DNS. Who wants to sync every host when there's an established network resource & protocol for it's administration?!
    – OMG Ponies
    Nov 1, 2009 at 4:58
  • 1
    Most conventions say you've got it backwards and the host specific part should be leftmost.
    – Jason
    Nov 1, 2009 at 5:01
  • 1
    @Jim: A class A ip range is a tad large ;) DNS isn't a resource hog, and provides more value when configuration is centralized. Who knows what will happen to the network in the future...
    – OMG Ponies
    Nov 1, 2009 at 5:09
  • 1
    @alex: Then make you life easier by implementing a DNS server...
    – OMG Ponies
    Nov 1, 2009 at 5:11
2

Do you really want to have to sync the hosts file on every host involved, every time you make an update? It's fine to me if you're only dealing with 2 hosts.

The alternative is to setup a DNS server (typically BIND on *nix/BSD) - you can change entries as you like, just have to configure the network to point to the DNS server. DNS is fairly static - once setup, there isn't any maintainence.

Reference:

4
  • Thanks Rexem. If I install DNS, how should I name the HOSTNAME? thanks.
    – Alex
    Nov 1, 2009 at 5:16
  • @Alex: I don't understand your question. You can name a network resource whatever you like, so long as it is unique. A common convention I've seen is to use astrological (earth, sun, moon, mars, etc) or greek mythology (zeus, hera, apollo, etc).
    – OMG Ponies
    Nov 1, 2009 at 5:21
  • 1
    @rexem, the Earth, Sun, Moon and Mars, aren't astrological, they really exist. Try astronomical ;-D
    – pavium
    Nov 1, 2009 at 5:40
  • 1
    Dammit pavium - I'm a developer, not an astronomer :p
    – OMG Ponies
    Nov 1, 2009 at 5:49
0

You should also look at using mDNS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .