• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

DNS Zones And Domains

I am trying to figure out how to set up BIND DNS so that there are more than one DNS domain in a DNS zone. I have looked this up in half a dozen books and they all say it can be done but do not describe how to do it - they all only give examples of there being one DNS zone in a DNS domain and then seem to use the terms zone and domain interchangably. Which I suppose makes sense when the zone and the domain are the same thing.  Do you need a seperate
database files for each domain in the zone ? or is there only one zone database covering all the domains ? Can anyone help ? By the way this is not a real world problem - I am just me trying to figure out  how DNS works. And am confused about DNS domains and zones.
0
AlanT
Asked:
AlanT
  • 5
  • 4
  • 4
  • +2
1 Solution
 
Handy HolderSaggar maker's bottom knockerCommented:
0
 
meverestCommented:
what do you mean by different domains in one zone? as in www.company.com and www.site1.company.com, www.site2.company.com?

or do you mean comapany1.com and company2.com?

if the former, it is easy enough, just put it all into the one zone file like:

company.com IN SOA ..etc,etc

...ns records..
...mx records..

www IN A nnn.nnn.nnn.nnn
www.site1 IN A mmm.mmm.mmm.mmm
www.site2 IN A lll.lll.lll.llll

----- note the period marks -----

if the latter, then you just make several zone files (just use any existing zones as a template/guide), and make sure that you put the zone in the named.boot file.  for NT BIND, this file is c:\winnt\named.boot (or rather %systemroot%\named.boot

cheers.

0
 
AlanTAuthor Commented:
Thanks for the information Meverest. . I actually meant the first of your two examples but describing both cases as you have lends clarity to your explanation. Just to make sure I have understood would the BIND boot file for a zone containing  the domains  company. , london.company. ,  newst.london.company . and maddoxst.london.company look like this :-


cache                  .                  cache.dns

primary                  company                 company.dns
primary                  london.company            company.dns
primary                  newst.london.company      company.dns
primary                  maddoxst.london.company company.dns
primary                  100.129.inadr.arpa      100.129.inadr.arpa.dns
primary                  102.10.inadr.arpa            100.120.inadr.arpa.dns


That is to have multiple domains in a zone do you just have multiple references to the zone database – one reference for each domain ?  If you post an answer either confirming or correcting me I will award the 250 points.
                  
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
bigezyCommented:
No,
The third field in the cache file indicates the name of the file stored in the DNS servers name.cache directory
the file goes like this:
primary [domain name] [filename]

The way you have the file set up in your example would point name lookups to the same file. DNS services are a distributed (across the Internet) database. The third field is simply the name that the server will associated with the zone file.

If you were to name all those domains to the same file. They would all use the same file on forward lookups, so if you looked up www.company or www.london.company you woudl get returned the same IP number
0
 
meverestCommented:
no, you just need the one etry in the named.boot - ie company.com - and add entries as above, noting lack of periods at the end of each:


www IN A <address>
www.london IN A <address>
www.maddoxst.london IN A <address>

... etc ..

but i can't post an answer now, as it seems that someone has beat me to it.

;-l

cheers.



0
 
AlanTAuthor Commented:
bigezy thanks for the information I am only rejecting this answer to allow further discussion.


I now  understand that I only need to have a reference to the highest level domain in the  zone in the DNS boot file. But are you right in thinking that  the result of multiple  references to the zone database in  the DNS Boot file,  would be for hosts  in different domains in the zone to be mapped to the same IP address ?   The IP mappings are provided by the DNS zone database file   and if there were separate mappings for www.company  and www.london.company in  the  zone database their names could be successfully resolved.

I don’t know  for sure what would happen if I set up the boot file incorrectly as I described  but would suspect that either the DNS service would not start or it would start but only read the first reference to the zone file and ignore all the others but the first reference is correct so DNS would work ok – i.e. I don’t need all those references to the sub domains of company but their presence does no harm.

In either case  the effect would not be incorrect name resolutions.  If you can point out the flaw in my logic I will ask EE support to split the points and award yourself and meverest  125 points each.  But if I am right and your information about incorrect name resolutions is not true  I will make the split 150 points to meverest and 100 points to you. Does that seem fair ?

Thanks for your input.
0
 
bigezyCommented:
Alan whatever you decide about the points is fine. The only point I was trying to make about wrong dns entries is if you had the following

primary company company.dns
primary london.company company.dns

and the company.dns file had the following lines

www in a 1.1.1.1

and then someone did a lookup on
www.london.company they would get 1.1.1.1
and on www.company they would get 1.1.1.1
If this is you intended purpose then that is the way to do this. But, if www.london.company and ww.company have two different addresses then you have to use seperate files, or end the hostname in a dot. The DNS daemon reads the file top to bottom.
The best way to do this would be to assign a different filename to each domain, or respective subdomain.

If you would like to take this discussion offline. I would be more than happy to discuss this.
Edmond
 
0
 
meverestCommented:
i disagree with bigezy.

if you want subdomains, you *do not* need seperate zone files.  one will do, and one is the proper way to handle it, unless you want to host the subdomains on a different DNS host (in which case you do it defferent again - look at o'reilys 'DNS and BIND' for the last word on dns ;-)

alant - all you need is one zone file.

www IN A <address>
www.london IN A <address1>
www.maddoxst.london IN A <address2>
...etc..

or, if you use the full hostnames, you can do:


www.company.com. IN A <address>
www.london.company.com. IN A <address1>
www.maddoxst.london.company.com. IN A <address2>

(note the trainilng period on the fully qualified hostnames)

cheers.


0
 
bigezyCommented:
I disagree with your disagreement. It can be done BOTH ways, and O'reily is not the bible of DNS:)
I have personally set DNS up this way on sites such as louisville.edu. The DNS system is simply a distributed database. And, the bottom line is that both of us are right. It is a matter of elegance in design.

If Alan does it the way you describe above it will work. But, if you have to administer a complex set of domains and subdomains this method tends to not be as portable. If for example you were going to extend autority for london.company to another dns server.



0
 
meverestCommented:
sure,

and although oreilly may not be the 'bible of dns', it is arguably the 'bible of BIND' ;-)

cheers.
 
0
 
AlanTAuthor Commented:
Looks like this is a case of "experts differ". I cannot tell which of you is right but the advice you have both given and the debate you have had about the best way to install multiple domains in a DNS zone have contributed  greatly towards getting me to understand DNS and BIND. Much more so than the books I have read. So I will ask EE support to split the points so that you will get 125 points each.

You both mention DNS and BIND by O'Reilly - is this the book I should be reading if I  really want to understand DNS ?
0
 
bigezyCommented:
Alan:
Yes, the O'Reilly book is the best place to go to get you off the ground for DNS. Highly reccommended, I agree with 90% of the book :)
Edmond
0
 
meverestCommented:
i agreewith you there bigezy ;) as for points, better to choose whoever you think has answered the question most effectively for you.  if you really want to give someone else points, just post a new question titled "points for <whoever>" to answer.

cheers.
0
 
AlanTAuthor Commented:
I am rejecting this answer at the advice of EE Support so that they can split up the points and award them as I have described.
0
 
ianBCommented:
AlanT accidently accepted the answer to this question so I have issued a question for meverest to claim his share of the points.

Ian
Community Support @ Experts Exchange
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 5
  • 4
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now