手机版
你好,游客 登录 注册
背景:
阅读新闻

Gentoo下搭建DNS服务器实验笔记

[日期:2013-05-25] 来源:Linux社区  作者:chengchow [字体:大 中 小]

网络环境

Hostname: zhengwing.org; mail.zhengwing.org; pop3.zhengwing.org; smtp.zhengwing.org.

IP add:192.168.254.123/24

Defaultgw:192.168.254.2

DNS server:192.168.254.2(Replace IP address to 192.168.254.123 when set completed.)

 

1、USE=”dlz” emerge –av bind

2、Emerge –av bind-tools

3、Vi /etc/bind/named.conf

options{

directory "/var/bind";

listen-on-v6 { none; };

listen-on {192.168.254.123;};

pid-file "/var/run/named/named.pid";

};

zone "." IN{

type hint;

file "named.ca";

};

zone "localhost" IN{

type master;

file "pri/localhost.zone";

allow-update {none;};

notify no;

};

zone "127.in-addr.arpa" IN {

type master;

file "pri/127.zone";

allow-update {none;};

notify no;

};

 

 

4.vi /etc/resolv.conf

Nameserver 192.168.254.2

 

 

5.dig –t NS

6.拷贝根目录IP添加到/etc/resolv.conf

格式为:nameserve r198.41.0.4

Nameserver192.228.79.201

…………………………………

Nameserver192.36.148.17

7.dig –t NS . > /var/bind/named.ca

Vi /var/bind/named.ca 如下图

8.vi /etc/resolv.conf

Nameserver 127.0.0.1

#:Nameserver 192.168.254.123

#删除其他的NAMESERVER

 

 

9./etc/init.d/named restart

10.测试

Host www.gentoo.org

如图,正向与反向解析成功。

11.添加邮件服务器域名解析功能

11.1 vi /etc/bind/named.conf

#添加一下内容

zone "zhengwing.org" IN{

type master;

file "pri/zhengwing.org.zone";

allow-update {none;};

notify no;

};

zone "192.in-addr.arpa" IN {

type master;

file "pri/zhengwing.org_reverse.zone";

allow-update {none;};

notify no;

};

 

 

11.2添加解析文件

Cd /var/bind/pri

Vi zhengwing.org.zone

*$TTL 1W

@INSOAzhengwing.orgroot.zhengwing.org.(

2010091808 ; Serial

28800; Refresh

14400; Retry

604800; Expire - 1 week

86400 ); Minimum

@INNSzhengwing.org.

@INA192.168.254.123

 

mailINCNAME zhengwing.org.

smtpINCNAMEzhengwing.org.

pop3INCNAMEzhengwing.org.

@INMX 5mail.zhengwing.org

 

 

Vi zhengwing.org_reverse.zone

*$ORIGIN 192.in-addr.arpa.

$TTL 1W

@1D IN SOAzhengwing.orgroot.zhengwing.org. (

2010092204; serial

3H; refresh

15M; retry

1W; expiry

1D ); minimum

 

@1D IN NSzhengwing.org.

 

123.254.1681D IN PTRzhengwing.org.

123.254.1681D IN PTRmail.zhengwing.org.

123.254.1681D IN PTRsmtp.zhengwing.org.

123.254.1681D IN PTRpop3.zhengwing.org.

 

 

11.3 测试

 

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款