Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



PTR Records

These are tricky. Format: IP PTR name Assumptions: There is a reverse_domain that IP can be tied to. This means that if you want to make a pointer with the address but you don't have the reverse_domain 192.168 (or something like it) then you won't be able to create that ptr. Case 1) name is within a valid subdomain of some domain in the domain table. Case 2) name is within some domain that is not in the domain table. a) domain should be 0 b) name should be the full domain name (i.e.

CNAME Records

These are almost as tricky. Format: name CNAME other_name Assumptions: name is a valid name (ie it is under a valid domain in the domain table). Case 1) other_name is under a valid domain in the domain table Case 2) other_name is not under a valid domain a) domain should be 0 b) the name field in the db should be the full name (i.e.

pseudo DHCP build

print's are not in final place

Printing class and subclass defintions (dynamic host records)

for dyn_range in Range.filter( type='dynamic' ):
    for local_ctnr in Range_CTNR.objects.filter( range = dyn_range ).get_related( CTNR ): #Join
        class_name = '"'':'+dyn_range.start+':'+dyn_range.stop+'"'
        print 'class ${class_name} {'
        print_class_options( ) #TODO
        print '}'
        hosts = Dynamic_Registions.filter( ctnr = local_ctnr and range = dyn_range )
        for host in hosts:
            print 'subclass "${class_name}" 1:'+host.ha

Printing Subnet declarations.

for subnet in Subnet.all():
    print "subnet "+subnet.subnet+" netmask "+subnet.netmask+" {"
    print_subnet_options( )
    for dyn_range in range.filter( subnet = ):
        # Sanity check
        if dyn_range.type != "dynamic":

        # Priting pool statements.
        print "    pool {"
        print_pool_options( )
        for local_ctnr in range_CTNR.filter( range = ).get_related( CTNR ): #Join
            class_name = '"'':'+dyn_range.start+':'+dyn_range.stop+'"'
            print "allow members of "+class_name

        print "range "+str(dyn_range.start)+" "+str(dyn_range.stop)";"
        print "     }"
    print "}"

Printing Group declarations

for local_group in Group.all():
    print "group "" {"
    print_group_options( )
    for registration in static_registration.filter( group = )
        a_record = Forward.filter( registration.A )
        ip = Ip.filter( id = a_record.ip )
        print "host "+a_record.dname() { #dname is constructed by the A class
        print "     fixed-address "+ip.ip_str+";"
        print "     hardware ethernet "+registration.ha+";"
    print "}"

Santiy Checks

  • All dyn registrations should be tied to a dynamic range.
  • Once a domain has an SOA, all subdomains should have the same SOA ... kind of. A domain can start a new soa, but the soa has to "trickle down"
  • A mac ip pair is unique. This will need to be enforced across a join since a mac's ip is a referece within an A record.
Something went wrong with that request. Please try again.