百度空间 | 百度首页 
 
查看文章
 
Ubuntu Server 8.04 DNS安装和初级配置学习笔记.
2008-05-15 05:05 P.M.

我原来只用过Redhat Linux和RedFlag Linux。突然间接触到Ubuntu,感觉不太习惯,连DNS的配置都花了一天时间研究,说来真是惭愧! 我其实是个Linux初学者,希望能和各位Linux爱好者共同学习Linux.

一,DNS的安装:

$sudo apt-get install bind9

正在读取软件包列表...
正在分析软件包的依赖关系树...
Reading state information...
bind9
已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 4 个软件未被升级。

二,DNS的配置:

DNS的相关配置文件存放在 /etc/bind,其中named.confnamed.conf.local都可以用来作主配置文件.配置前最好把他们先备份一下.

$sudo cp named.conf named.conf.bak

$sudo cp named.conf.local named.conf.local.bak

现在开始配置DNS,

$sudo vim named.conf 进去后在最下面添加红色部分

zone "wuhan.com" IN {

        type master;

        file "/etc/bind/wuhan.com"; 这里和其他linux不一样,这必须指定绝对路径,就因为我忽略了这里才花了我很长时间来配置成功.

};

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

        type master;

        file "/etc/bind/wuhan.com"; 我平时喜欢偷懒,才把正向和反向文件写进一个文件内.

};

保存退出后 $sudo vim wuhan.com

; BIND reverse data file for empty rfc1918 zone

;

; DO NOT EDIT THIS FILE - it is used for multiple zones.

; Instead, copy it, edit named.conf, and use that copy.

;

$TTL      86400

@    IN    SOA       wuhan.com. root.localhost. (

                           1         ; Serial

                     604800              ; Refresh

                     86400        ; Retry

                     2419200              ; Expire

                     86400 )     ; Negative Cache TTL

;

@    IN    NS   www

www       IN    A     192.168.1.120

ftp   IN    A     192.168.1.120

120 IN    PTR       www.wuhan.com.

120 IN    PTR       ftp.wuhan.com.

保存退出。DNS已经配置好,

$sudo vim /etc/resolv.conf,修改为nameserver 192.168.1.120

重启BIND9

$sudo /etc/init.d/bind9 restart

* Stopping domain name service... bind       [80G [74G[ OK ]

* Starting domain name service... bind       [80G [74G[ OK ]

最后测试DNS:

$nslookup

>www.wuhan.com

Name:    www.wuhan.com

Address: 192.168.1.120

Server:          192.168.1.120

Address:       192.168.1.120#53

>192.168.1.120

120.1.168.192.in-addr.arpa      name = www.wuhan.com.

120.1.168.192.in-addr.arpa      name = ftp.wuhan.com.

Server:          192.168.1.120

Address:       192.168.1.120#53

能够解析,完成收工,再去研究辅助DNSDNS委派配置.

一,DNS

};

zone "wuhan

能够解析,


类别:Ubuntu Linux | 添加到搜藏 | 浏览() | 评论 (1)
 
最近读者:
 
网友评论:
1
2008-05-19 07:24 P.M. | 回复
主题怎么像是sohu博客中的一款
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu