linux dns服务器配置_第1页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、linux dns服务器配置1. 查看服务器上是否安装了dns服务 rpm -qa | bind bind-uti-9.3.6-16.p1.el5 bind-9.3.6-16.p1.el5 rpm -qa | grep name caching-nameserver-9.3.6-16.p1.el5 需要有这几个rpm。 2. 修改配置文件(其实精心的人会发觉次文件为链接文件,详细看下文错误2) /etc/nam.caching-nameserver.conf / named.caching-nameserver.conf / proved by red hat caching-nameserv

2、er package to configure the / isc bind named(8) dns server as a caching only nameserver / (as a localhost dns resolver only). / see /usr/share/doc/bind*/sample/ for ample named configuration s. / do not edit this file - use system-config-bind or an editor / to create named.conf - edits to this file

3、will be lost on / caching-nameserver package upgrade. options listen-on port 53 any; ; listen-on-v6 port 53 :1; ; directory "/var/named" mp-file "/var/named/data/cache_.db" istics-file "/var/named/data/named_stats.txt" memstatistics-file "/var/named/data/named_mem_

4、stats.txt" / those options should be u carefully because they disable port / randomization / query-source port 53; / query-source-v6 port 53; allow-query any; ; allow-query-cache any; ; logging channel default_debug file "data/named.run" severity dynamic; ; view localhost_resolver mat

5、ch-clients any; ; match-destinations any; ; recursion yes; ilude "/etc/named.rfc1912.zones" 把以上的localhost和都改成any,假如不改他只能让主机来拜访。 3. 在/etc/named.rfc1912.zones文件中添加一些东西 cat /etc/named.rfc1912.zones / named.rfc1912.zones: / provided by red hat caching-nameserver package / isc bind nam

6、ed zone configuration for zones recommended by / rfc 1912 section 4.1 : localhost tlds and aress zones / see /usr/share/doc/bind*/sample/ for example named configuration files. zone "." in type hint; file "named.ca" zone "localdomain" in type master; file "localdom

7、ain.zone" allow-up none; ; zone "localhost" in type master; file "localhost.zone" allow-update none; ; zone "0.0.127." in type master; file "named.local" allow-update none; ; zone ".......0

8、.0.0." in type master; file "named.ip6.local" allow-update none; ; zone "255." in type master; file "named.broadcast" allow-update none; ; zone "0." in type master; file "named.zero" allow-update none; ; zone &quo

9、t;" in type master; file "baidu.zheng" 红色部分为添加的,意图为正向解析 4. 上面添加的baidu.zheng文件应当在/var/named下面配置,进入名目执行 named.zero baidu.zheng,其实这个名目下面应当是链接文件,真正的文件是放在/var/named/chroot/var/named下面,copy后baidu.zheng为正确的链接文件就对了,否则需要到/var/named/chroot/var/named名目下面创建,然后修改baidu.zheng文件 cat /var/named/baidu.

10、zheng $ttl 86400 in soa localhost. root.localhost. ( 42 ; serial (d. adams) 3h ; refresh 15m ; rey 1w ; expiry 1d ) ; minimum in ns . dns in a 19 www in a 15 后面有注释,a即address localhost.localdomain为我的主机名,主机名可以在/etc/sysconfig/network下面修改,注销后生效 5. 重启dns使之生效,service named restart。 6

11、. 测试: nsup ; got recursion not available from , trying next server server: address: 53 name: address: 20 nslookup server: address: 53 non-authoritative answer: canonical name = . name: address: 05 name: address: 61.135.

12、169.125 这里的错误缘由是本机的dns没有更改还是用的局域网内的dns,更改dns再测试,下文的错误3,有详细说明。 修改后测试 nslookup server: 19 address: 1953 name: address: 19 nslookup server: 19 address: 1953 name: address: 15 7. 配置反向解析在/etc/named.rfc1912.zones文件下面添加以下行 zone "247.10.

13、10." in type master; file "baidu.fan" 我的ip是10.10.247网段的,所以黄色部分应当那样写,ip倒过来写 8. 拷贝文件cp /var/named/baidu.zheng /var/named/baidu.fan,假如拷贝后为链接文件就是对的,否则应当拷贝到/var/named/chroot/var/named,然后修改baidu.fan文件: cat baidu.fan $ttl 86400 in soa localhost. root.localhost. ( 1997022700 ; ser

14、ial 28800 ; refresh 14400 ; retry 3600000 ; expire 86400 ) ; minimum in ns . 119 in ptr . 115 in ptr . 红色部分为修改文件,前面的119 115为ip最后一位 9. 重启dns使之生效service named restart,然后执行指令nslookup 19, nslookup 19 server: 19 address: 1953 0. name = .

15、 nslookup 15 server: 19 address: 1953 0. name = . service named restart 停止 named:确定 启动 named: named配置错误:: zone localdomain/in: loaded serial 42 zone localhost/in: loaded serial 42 zone 0.0.127./in: loaded serial 1997022700 zone 0.0

16、........0./in: loaded serial 1997022700 zone 255./in: loaded serial 42 zone 0./in: loaded serial 42 dns_rdata_fromtext: baidu.zheng:9: near '19.': bad dotted quad dns_rdata_fromtext: baidu.zheng:10: n

17、ear '15.': bad dotted quad zone loading master file baidu.zheng: bad dotted quad localhost_resolver/ bad dotted quad 配置正向解析的时候有这个报错,后来反复测试发觉在baidu.zheng文件中应当注重: cat baidu.zheng $ttl 86400 in soa localhost. root.localhost. ( 42 ; serial (d. adams) 3h ; refresh 15m ; retry 1w ; expi

18、ry 1d ) ; minimum in ns . dns in a 19. www in a 15. 在ip后面的.应当去掉,做事情应当仔细。 报错2.启动失败提醒找不到文件*,一定要认准真正的名目在哪里,我这就犯了个这个问题,其实默认应当是在/var/named/下面创建向上文说的baidu.zheng、baidu.fan,但是精心的人会发觉ll看一下 总计 52 drwxr-x- 6 root named 4096 02-14 22:28 chroot drwxrwx- 2 named named 4096 2011-02-23 data lr

19、wxrwxrwx 1 root named 45 2011-11-20 localdomain.zone - /var/named/chroot/var/named/localdomain.zone lrwxrwxrwx 1 root named 43 2011-11-20 localhost.zone - /var/named/chroot/var/named/localhost.zone lrwxrwxrwx 1 root named 44 2011-11-20 named.broadcast - /var/named/chroot/var/named/named.broadcast lr

20、wxrwxrwx 1 root named 37 2011-11-20 named.ca - /var/named/chroot/var/named/named.ca lrwxrwxrwx 1 root named 44 2011-11-20 named.ip6.local - /var/named/chroot/var/named/named.ip6.local lrwxrwxrwx 1 root named 40 2011-11-20 named.local - /var/named/chroot/var/named/named.local lrwxrwxrwx 1 root named 39 2011-11-20 named.zero - /var/named/chroot/var/named/named.zero drwxrwx- 2 named named 4096 2011-02-23 slaves 文件都是链接文件,真正的文件在/var/named/chroot/var/named下面,在这个名目先买年创建文件,可以正常启动,不知道为什么都是链接文件,大概是我安装了rpm包然后卸载又重新安装的缘

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论