Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have nameservers and I wanted to delegate subdomains on nameserver A to nameserver X where X is a local workstation name server

example would be: TLD is company.com any queries to host.XXXX.company.com would be delegated to that XXXX's nameserver. X can vary as it would be some sort of 'personal' nameserver.

so i imagine company.com zone file would be like

$ORIGIN company.com. $TTL 6h

@ IN SOA company.com. root.company.com. (
  1
  1h
  30m
  7d
  1h)

  NS  ns.company.com.
  A   10.1.1.1

;so these names are potential XXXX
foo    A   10.1.1.3
bear   A   10.1.1.2
ns     A   10.1.1.1

and XXXX's(or lets say foo.company.com) zone file would be like (this is found in another nameserver, not the same as above)

$ORIGIN foo.company.com. $TTL 6h

@ IN SOA foo.company.com. root.company.com. (
  1
  1h
  30m
  7d
  1h)

  NS  ns.foo.company.com.
  A   10.1.1.3

ns     A   10.1.1.3

am i doing this right?

summary is, when someone would access foo.company.com, company.com NS would resolve it

but when lets say i have a host on foo, named 'test' so when someone accesses test.foo.company.com, it goes first to company.com but delegates it to foo.company.com name server and would resolve 'test' there.

share|improve this question
    
If the subdomain is going to be used on your local network with your local dns server why don't you just set your dns server to be your network dns ? this way you dont need to rely on your outer dns and can go directly with setting up the subdomain on it. –  Prix Oct 19 '10 at 4:12
add comment

1 Answer

I have no experience on sending a subzone of a zone to another dns server but in theory your logic is right:

Entry on /etc/named.conf for domain.com:

zone "domain.com" {
    type master;
    file "/var/name/domain.com.zone";
};

domain.com zone file /var/name/domain.com.zone:

; zone fragment for domain.com
; name servers in the same zone
$TTL 2d ; default TTL is 2 days
$ORIGIN domain.com.
@              IN      SOA   ns1.domain.com. hostmaster.domain.com. (
               2010101801 ; serial number
               2h         ; refresh =  2 hours 
               15M        ; update retry = 15 minutes
               3W12h      ; expiry = 3 weeks + 12 hours
               2h20M )    ; minimum = 2 hours + 20 minutes

; main domain name servers
              IN      NS     ns1.domain.com.
              IN      NS     ns2.domain.com.

; main domain mail servers
              IN      MX     10 mail.domain.com.

; A records for name servers above 
ns1           IN      A      10.0.0.1
ns2           IN      A      10.0.0.2

; A record for mail server above 
mail          IN      A      10.0.0.3

; Subdomain of domain.com
foo           IN      A      10.0.0.100

Entry on 10.0.0.100 dns server /etc/named.conf for foo.domain.com on the other dns server:

zone "foo.domain.com" {
    type master;
    file "/var/name/foo.domain.com.zone";
};

foo.domain.com zone file /var/name/foo.domain.com.zone on 10.0.0.100:

; zone fragment for domain.com
; name servers in the same zone
$TTL 2d ; default TTL is 2 days
$ORIGIN foo.domain.com.
@              IN      SOA   ns1.foo.domain.com. hostmaster.foo.domain.com. (
               2010101811 ; serial number
               2h         ; refresh =  2 hours 
               15M        ; update retry = 15 minutes
               3W12h      ; expiry = 3 weeks + 12 hours
               2h20M )    ; minimum = 2 hours + 20 minutes

; main domain name servers
              IN      NS     ns1.foo.domain.com.

; main domain mail servers
              IN      MX     10 mail.foo.domain.com.

; A records for name servers above 
ns1           IN      A      10.0.0.100

; A record for mail server above 
mail          IN      A      10.0.0.3

So from what i see it would send foo.domain.com to it is given ip at DNS A where it would be recognized as a domain on DNS B and would resolve whatever new entries it has.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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