Chinaunix首页 | 论坛 | 博客
  • 博客访问: 107480
  • 博文数量: 38
  • 博客积分: 1520
  • 博客等级: 上尉
  • 技术积分: 325
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-20 11:12
文章分类

全部博文(38)

文章存档

2012年(4)

2011年(1)

2010年(7)

2009年(21)

2008年(1)

2007年(4)

我的朋友

分类:

2007-09-19 10:19:18

三.Dns数据在Berkeley中的关系以及存储方式

1.数据结构

定义:typedef struct bdb_instance {

       DB_ENV  *dbenv;       

       DB   *data;          

       DBC *cursor;

       DBC *cursor2;

       DBC *cursor3;

       DBC *cursor4;

       DB   *zone;         

       DB   *xfr;             

       DB   *client;  

} bdbhpt_instance_t;

1.  表及算法

包括:dns_data

         dns_zone

      dns_host

      dns_client

 

Dns_data

Hash

key

Zone+a space+host

value

Dns data

Dns_xfr

Hash

key

zone

value

host

Dns_zone

Btree

key

Reverse zone

value

NULL

Dns_client

Hash

key

Zone

 

value

Xfr ip

3. dns data字段:

Order

Name

Data Type

Description

1

replication_id

string

a unique alpha-numeric id for this record.

2

host

string

DNS host name

3

ttl

string (num)

Time to live (string must convert to number)

4

type

string

DNS data type

5

mx_priority

string (num)

MX Priority (only for MX DNS types)

6

data

string

IP address / Host name / Full domain name

7

primary_ns

string

Primary name server SOA record (SOA ONLY)

8

resp_person

string

Responsible person SOA record (SOA ONLY)

9

serial

string (num)

Serial # for SOA record (SOA ONLY)

10

refresh

string (num)

Refresh timefor SOA record (SOA ONLY)

11

retry

string (num)

Retry time for SOA record (SOA ONLY)

12

expire

string (num)

Expire time for SOA record (SOA ONLY)

13

minimum

string (num)

Minimum time for SOA record (SOA ONLY)

 

4.各表之间的逻辑关系

       Dns_client是控制客户端多台同步

Dns_xfrDns_client允许增量传输的zonehost

Dns_zonereverse zone能提高查询速度,其值为空,当查询zone的时候其关系为:

       Dns_zone--àdns_xfràdns_data

Dns_data 是最终数据集,当查host时的关系为:

       Dns_xfràdns_data

5.实例数据

bind+bdbhpt官方文档有几个错误,数据要严格按照下面的来定义

[dns_zone] key: moc.tset , data:

[dns_client] key: test.com , data: 127.0.0.1

[dns_client] key: test.com , data: 192.168.1.10

[dns_xfr] key: test.com , data: @

[dns_data] key: test.com @ , data: 1 @ 86400 SOA ns1.test.com. hostmaster.test.com. 2006112401 28800 7200 604800 86400

[dns_xfr] key: test.com , data: download

[dns_data] key: test.com download , data: 18 download 600 A 192.168.1.15

[dns_data] key: test.com download , data: 19 download 600 A 192.168.1.16

[dns_xfr] key: test.com , data: video

[dns_data] key: test.com video , data: 20 video 600 A 192.168.1.17

[dns_data] key: test.com video , data: 21 video 600 A 192.168.1.18

[dns_xfr] key: test.com , data: www

[dns_data] key: test.com www , data: 10 www 600 A 192.168.1.19

[dns_data] key: test.com www , data: 11 www 600 A 192.168.1.10

[dns_data] key: test.com www , data: 12 www 600 A 192.168.1.20

阅读(961) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~