一、 安装
apt-get install bind9
apt-get install bind9-host dnsutils
apt-get install bind9-doc 二、修改本机配置
我们要事先把Debian机器的DNS指向它自己。修改/etc/resolv.conf,修改成: 
#DNS  of  test111.com 
nameserver 127.0.0.1 三、配置
cd /etc/bind
vim named.conf.local
增加正向解析和反向解析区域(zone):
zone "test111.com" {
     type master;
     file "/etc/bind/db.test111.com";
}; 
zone "168.192.in-addr.arpa"  {
     type master;
     file "/etc/bind/db.192.168";
}; 1.1 正向解析:db.test111.com内容如下:
$TTL    604800
@   IN  SOA test111.com. admin.test111.com. (
                  2     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
@   IN  NS  ns.test111.com.
@   IN  A   192.168.10.2
ns  IN  A   192.168.10.2
www IN  CNAME @
ftp IN  CNAME @
proxy IN CNAME @
blog IN CNAME @
test IN CNAME @
mysql IN CNAME @
* IN A 192.168.10.2
这里指定了域test111.com的dns服务器为ns.test111.com. 即为本机。因为下面的正向解析记录的A记录将它解析到了本机了。
并且添加了好几个CNAME(别名)记录,都指向192.168.10.2 。
最后添加泛解析支持,所有对*.test111.com的请求都会被解析到192.168.10.2 。 1.2 反向解析:db.192.168内容如下:
$TTL    604800
@   IN  SOA test111.com. admin.test111.com. (
                  1     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
@   IN  NS  ns.test111.com.
2.1 IN  PTR test111.com.
这里的反向解析很简单,就是将192.168.10.2指向test111.com
2.配置cache(缓存)dns服务器
vim named.conf.options
去掉其中几个注释符号(//) ,添加你所在网络的ISP (internet 信息服务提供商)的DNS 。最后内容如下:
options {
    directory "/var/cache/bind";     // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk.  See http://www.kb.cert.org/vuls/id/800113     // If your ISP provided one or more IP addresses for stable
    // nameservers, you probably want to use them as forwarders.  
    // Uncomment the following block, and insert the addresses replacing
    // the all-0's placeholder.     forwarders {
    218.2.135.1;
    202.102.24.35;
    61.147.37.1;
    };     auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
};

参考:http://blog.csdn.net/bluecy/article/details/44907215

最新文章

  1. python基础-面向对象编程
  2. 初识Scala反射
  3. SQL查询到的数据放到DataSet中
  4. python基础之迭代与解析
  5. [Linux] yum和apt-get用法及区别
  6. MySQL主存复制与读写分离的感悟
  7. 基于jquery的inputlimiter 实现字数限制功能
  8. Centos 6.5中使用yum安装jdk
  9. JavaScript设置右下角悬浮窗
  10. NFC的安全性
  11. C#操作Xml:使用XmlWriter写Xml
  12. Python处理图片缩略图
  13. pdf文件下载水印添加的中文与空格问题解决
  14. Vue(小案例_vue+axios仿手机app)_购物车(二模拟淘宝购物车页面,点击加减做出相应变化)
  15. mongodb实现自增的方法
  16. [转]Python shutil 模块
  17. browsersync即时刷新页面
  18. 常用的API接口
  19. 【SQLSERVER】从数据库文件mdf中拆分ndf的方法和利弊
  20. Thunder团队第五周 - Scrum会议6

热门文章

  1. Partitioning by Palindromes UVA - 11584 简单dp
  2. 翻译 | 卷积码的维特比(Viterbi)译码
  3. 常用 Git 命令清单【转--阮一峰】
  4. webstorm git提交不成功的
  5. Java中的初始化详细解析
  6. jeakins用户配置
  7. 易语言.开源(vip视频播放器源码)
  8. 孤荷凌寒自学python第十七天初识Python的函数
  9. vmware中桥接丶仅主机丶net模式的区别
  10. 哈希URAL 1941 - Scary Martian Word