永发信息网

LINUX dns named 服务启动失败 高手来看看

答案:2  悬赏:0  手机版
解决时间 2021-04-08 06:48
[root@localhost named]# service named start
Starting named: [FAILED]

用tail /var/log/messages 看到如下信息

Jun 4 05:18:18 localhost named[6884]: /etc/named.conf:25: using specific query-source port suppresses port randomization and can be insecure.
Jun 4 05:18:18 localhost named[6884]: command channel listening on 127.0.0.1#953
Jun 4 05:18:18 localhost named[6884]: command channel listening on ::1#953
Jun 4 05:18:18 localhost named[6884]: the working directory is not writable
Jun 4 05:18:18 localhost named[6884]: zone 0.in-addr.arpa/IN/localhost_resolver: loaded serial 42
Jun 4 05:18:18 localhost named[6884]: zone 8.168.192.in-addr.arpa/IN/localhost_resolver: loaded serial 1997022700
Jun 4 05:18:18 localhost named[6884]: zone 255.in-addr.arpa/IN/localhost_resolver: loaded serial 42
Jun 4 05:18:18 localhost named[6884]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN/localhost_resolver: loaded serial 1997022700
Jun 4 05:18:18 localhost named[6884]: zone abc2.com/IN/localhost_resolver: loaded serial 42
Jun 4 05:18:18 localhost named[6884]: zone localhost/IN/localhost_resolver: loaded serial 42

1L 设置了没用
最佳答案
目录/var/named没有写入权限
修改一下:
chown -R root:named /var/named
另外配置文件/etc/named.conf也需要修改
chown root:named /etc/named.conf
全部回答
安装 bind 软件包 1、安装 # yum -y install bind caching-nameserver 2、配置 下面的例子是以公网ip(172.16.0.80/29),局域网ip(192.168.0.0/24),域名(linuxde.net)作说明。在配置你自己的服务器时,请使用你自己的ip和域名。 # vim /etc/named.conf options { directory "/var/named"; # query range allow-query { localhost; 192.168.0.0/24; }; # transfer range allow-transfer { localhost; 192.168.0.0/24; }; # recursion range allow-recursion { localhost; 192.168.0.0/24; }; }; controls { inet 127.0.0.1 allow { localhost; } keys { rndckey; }; }; # here is the section for internal informations vimew "internal" { match-clients { localhost; 192.168.0.0/24; }; zone "." in { type hint; file "named.ca"; }; # set zones for internal zone "linuxde.net" in { type master; file "linuxde.net.lan"; allow-update { none; }; }; # set zones for internal zone "0.168.192.in-addr.arpa" in { type master; file "0.168.192.db"; allow-update { none; }; }; zone "localdomain" in { type master; file "localdomain.zone"; allow-update { none; }; }; zone "localhost" in { type master; file "localhost.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa" in { type master; file "named.local"; allow-update { none; }; }; zone "255.in-addr.arpa" in { type master; file "named.broadcast"; allow-update { none; }; }; zone "0.in-addr.arpa" in { type master; file "named.zero"; allow-update { none; }; }; }; vimew "external" { match-clients { any; }; zone "." in { type hint; file "named.ca"; }; # set zones for external zone "linuxde.net" in { type master; file "linuxde.net.wan"; allow-update { none; }; }; # set zones for external *note zone "80.0.16.172.in-addr.arpa" in { type master; file "80.0.16.172.db"; allow-update { none; }; }; }; include "/etc/rndc.key"; # *note : for how to write for reverse resolvimng, write network address reversely like below. the case for 192.168.0.0/24 network address? 192.168.0.0 range of network? 192.168.0.0 - 192.168.0.255 how to write? 0.168.192.in-addr.arpa case of 172.16.0.80/29 network address? 172.16.0.80 range of network? 172.16.0.80 - 172.16.0.87 how to write? 80.0.16.172.in-addr.arp 设置zones 创建zone文件以便服务器能解析域名ip。 1、内部zone文件 这个例子使用的是内网地址(192.168.0.0/24),域名(linuxde.net),请根据自己的具体情况配置。 # vim /var/named/linuxde.net.lan $ttl 86400 @ in soa ns.linuxde.net. root.linuxde.net. ( 2007041501 ;serial 3600 ;refresh 1800 ;retry 604800 ;expire 86400 ;minimum ttl ) # define name server in ns ns.linuxde.net. # internal ip address of name server in a 192.168.0.17 # define mail exchanger in mx 10 ns.linuxde.net. # define ip address and hostname ns in a 192.168.0.17 2、外部zone文件 这个例子使用的是外网地址(172.16.0.80/29),域名(linuxde.net),请替换成自己的。 # vim /var/named/linuxde.net.wan $ttl 86400 @ in soa ns.linuxde.net. root.linuxde.net. ( 2007041501 ;serial 3600 ;refresh 1800 ;retry 604800 ;expire 86400 ;minimum ttl ) # define name server in ns ns.linuxde.net. # external ip address of name server in a 172.16.0.82 # define mail exchanger in mx 10 ns.linuxde.net. # define ip address and hostname ns in a 172.16.0.82 创建zone文件使服务器能够反向解析ip到域名。 3、内部zone文件 这个例子使用的是内网地址(192.168.0.0/24),域名(linuxde.net),请使用自己的设置替换。 # vim /var/named/0.168.192.db $ttl 86400 @ in soa ns.linuxde.net. root.linuxde.net. ( 2007041501 ;serial 3600 ;refresh 1800 ;retry 604800 ;expire 86400 ;minimum ttl ) # define name server in ns ns.linuxde.net. # define range that this domain name in in ptr linuxde.net. # define ip address and hostname in a 255.255.255.0 17 in ptr ns.linuxde.net. 4、外部zone文件 这例子使用外网地址(172.16.0.80/29),域名(linuxde.net),请替换成自己的。 # vim /var/named/80.0.16.172.db $ttl 86400 @ in soa ns.linuxde.net. root.linuxde.net. ( 2007041501 ;serial 3600 ;refresh 1800 ;retry 604800 ;expire 86400 ;minimum ttl ) # define name server in ns ns.linuxde.net. # define range that this domain name in in ptr linuxde.net. # define ip address and hostname in a 255.255.255.248 82 in ptr ns.linuxde.net. 启动bind 1、完成bind的配置后,在启动named之前,还需要建立chroot环境。 # yum -y install bind-chroot # /etc/rc.d/init.d/named start # chkconfig named on 2、操作检验 确认服务器已经正确解析域名或ip地址。 # dig ns.linuxde.net. ; <<>> dig 9.3.4 <<>> ns.linuxde.net. ;; global options: printcmd ;; got answer: ;; ->>header<<- opcode: query, status: noerror, id: 54592 ;; flags: qr aa rd ra; query: 1, answer: 1, authority: 1, additional: 0 ;; question section: ;ns.linuxde.net. in a ;; answer section: ns.linuxde.net. 86400 in a 192.168.0.17 ;; authority section: linuxde.net. 86400 in ns ns.linuxde.net. ;; query time: 0 msec ;; server: 192.168.0.17#53(192.168.0.17) ;; when: thu mar 8 19:35:19 2007 ;; msg size rcvd: 68 # dig -x 192.168.0.17 ; <<>> dig 9.3.4 <<>> -x 192.168.0.17 ;; global options: printcmd ;; got answer: ;; ->>header<<- opcode: query, status: noerror, id: 45743 ;; flags: qr aa rd ra; query: 1, answer: 1, authority: 1, additional: 1 ;; question section: ;17.0.168.192.in-addr.arpa. in ptr ;; answer section: 17.0.168.192.in-addr.arpa. 86400 in ptr ns.linuxde.net. ;; authority section: 0.168.192.in-addr.arpa. 86400 in ns ns.linuxde.net. ;; additional section: ns.linuxde.net. 86400 in a 192.168.0.17 ;; query time: 0 msec ;; server: 192.168.0.17#53(192.168.0.17) ;; when: thu mar 8 19:37:50 2007 ;; msg size rcvd: 107 配置从dns服务器 配置从dns服务器比较简单。下面的例子主dns是“ns.linuxde.net”,从dns是“ns.example.info”。 1、在主dns服务器的zone文件作如下配置 # vim /var/named/linuxde.net.wan $ttl 86400 @ in soa ns.linuxde.net. root.linuxde.net. ( # update serial 2007041501 ;serial 3600 ;refresh 1800 ;retry 604800 ;expire 86400 ;minimum ttl ) in ns ns.linuxde.net. # add name server in ns ns.example.info. in a 172.16.0.82 in mx 10 ns.linuxde.net. ns in a 172.16.0.82 # rndc reload server reload successful 2、配置从dns服务器 # vim /etc/named.conf # add these lines below zone "linuxde.net" in { type slave; masters { 172.16.0.82; }; file "slaves/linuxde.net.wan"; }; # rndc reload server reload successful # ls /var/named/slaves linuxde.net.wan # zone file in master dns has been just transfered 设置别名记录,如果你想为你的主机设置另一个名称,在zone文件定义cname记录 # vim /var/named/server-linux.info.wan $ttl 86400 @ in soa ns.server-linux.info. root.server-linux.info. ( # update serial 2007041501 ;serial 3600 ;refresh 1800 ;retry 604800 ;expire 86400 ;minimum ttl ) in ns ns.server-linux.info. in a 172.16.0.82 in mx 10 ns.server-linux.info. ns in a 172.16.0.82 # aliase in cname server's name ftp in cname ns.server-linux.info. # rndc reload server reload successful
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
观察《中国各历史时期天然植被破坏过程》示意
仪陇县中医医院-岐黄楼在什么地方啊,我要过
叶落天涯风为媒,雨这首诗是什么意思
怎么样看出玉米是不是转基因的
单选题如图所示,下列简单机械正常使用时属于
shell 循环比对变量是否相等
带有三国的人名歇后语,三国演义里的歇后语大
从辽宁葫芦岛或锦州到重庆万州的最快的路线怎
有没有浙江省内打的短号啊??就是在浙江省内
单选题“民生”问题是一个重要的社会问题。中
申请iso9001 2015审核需要做什么准备
旦白冲这个地址在什么地方,我要处理点事
网络诗歌真诚的祝福你
什么情况下 mrs见倒置乳酸峰 naa峰降低
今天好天气英语怎么说,英语 天气变好了 怎么
推荐资讯
关于当歌手(薛之谦)的理想的作文400字
我国人均森林面积居世界第几位?
战神z7m sl7d2 gtx965m显卡为什么丢失
李维嘉和李湘主持的那个相亲节目叫什么
为什么好多西方人恐惧小丑
K257次火车
不务正业近义词
给爱女取名字
单选题2007年2月,国家科技部通过的一项研究
单选题在我国秦岭-淮河以北,几乎年年都要发
北方有哪些地方,中国北方是哪些地方,南方是
笪桥桥苑综合市场地址有知道的么?有点事想过
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?