Friday, January 28, 2011

bind delegation

Hi, 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.

  • 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.

    From Prix

0 comments:

Post a Comment