学习网考试学习资料

Gzu521.com

动态DNS(1)

思科认证   点击:次   发布时间:2006-8-9   【字体: 】   来源:Gzu521.com
Gzu521.com学习网
1.核心思想 
   本资料来源于贵-州-学-习-网 IT认证思科认证 WWW.GZU521.COM
    配置动态dns服务器的核心思想是:在dns服务器上运行多个bind,每个bind为来自不同区域的用户提供解析,因此每个bind都应具有不同的配置文件和域文件,并且分别监听在不同的端口。在接到客户端dns请求时,根据客户的ip地址将请求重定向不同的bind服务端口。bind响应时,再改写相应包的服务端口为标准的53端口。这样就可以根据客户端的ip地址将不同的解析结果返回给客户端。整个过程对于客户端来说都是透明的。实现的关键在于运行不同的bind及运用iptables进行ip地址及端口改写操作。 
  
    关于iptables更为详细的信息,请参考解决方案中作者的两篇文章——《用iptales实现包过虑型防火墙》及《用iptables实现nat》。 
  
  2.配置过程 
  
  2.1.配置内核 
  
    netfilter要求内核版本不低于2.3.5,在编译新内核时,要求选择和netfilter相关的项目。这些项目通常都是位于"networking options"子项下。以2.4.0内核为例,我们应该选中的项目有: 
  
  [*] kernel/user netlink socket 
  [ ] routing messages 
  <*> netlink device emulation 
  [*] network packet filtering (replaces ipchains) 
  ....... 
  
    然后,在"ip: netfilter configuration ---->"选中: 
  
   connection tracking (required for masq/nat) 
   ftp protocol support 
   ip tables support (required for filtering/masq/nat) 
   limit match support 
   mac address match support 
   netfilter mark match support 
   multiple port match support 
   tos match support 
   connection state match support 
   packet filtering 
   reject target support 
   full nat 
   masquerade target support 
   redirect target support 
   packet mangling 
   tos target support 
   mark target support 
   log target support 
   ipchains (2.2-style) support 
   ipfwadm (2.0-style) support 
  
    其中最后两个项目可以不选,但是如果你比较怀念ipchains或者ipfwadm,你也可以将其选中,以便在2.4内核中使用ipchians或ipfwadm。但是需要注意的是,iptables是和ipchians/ipfwadm相对立的,在使用iptables的同时就不能同时使用ipchains/ipfwadm。编译成功后,这些模块文件都位于以下目录中 
  /lib/modules/2.4.0/kernel/net/ipv4/netfilter 
  
    编译2.4.0的新内核时还应该注意要在"processor type and features"中选择和你的cpu相对应的正确的cpu选项,否则新内核可能无法正常工作。 
  
  2.2.配置bind服务 
  
    缺省地,bind服务监听在53端口,我们可以通过配置让bind运行在不同的ip及端口上。实现这一点并不复杂,假设我们的dns服务器的ip地址是211.163.76.1,并且我们想区分cernet及非cernet的客户,这时我们必须运行两个bind,使用不同的配置文件。可以在使用非标准监听端口的bind的配置文件中用listen-on指定bind监听的端口,比如: 
  
  options { 
  listen-on port 54 {211.163.76.1;} 
  directory "/var/named_cernet"; 
  }; 
  
    可以用named的-c 选项指定named读入不同的配置文件,比如: 
  
  /usr/sbin/named -u named -c /etc/named_cernet.conf 
  
  2.3.配置重定向规则 
  
    假设监听在标准端口的bind服务器为非cernet客户提供dns解析,监听在54端口的bind服务器为cernet服务器提供dns解析,我们可以建立如下的规则脚本: 

本文共7页:上一页1234567下一页

责任编辑:gzu521

IT认证分类
计算机软件水平考试
全国计算机等级考试
思科认证
微软认证
ORACLE/CIW认证
Linux认证
JAVA认证
其它认证
分类推荐信息
更多...
大类最新文章
更多...