connect failed: 127.0.0.1#953: connection refused
Problem1 :
root@jeremy-VirtualBox:/etc/bind# /etc/init.d/bind9 restart
* Stopping domain name service... bind9 rndc: connect failed: 127.0.0.1#953: connection refused
[ OK ]
* Starting domain name service... bind9 [fail]
Solution :
默认安装BIND9以后,是无法直接使用 ndc 或 rndc 命令的。
先重新生成 rndc.conf
rndc-confgen > /etc/rndc.conf
将 rndc.conf 下面注释部分 Copy 到 /etc/rndc.key 文件中(必须将前面的#去掉)。
如:
# key "rndc-key" {
# algorithm hmac-md5;
# secret "xbPNyGOcwJp8pEJDLo26cQ==";
# };
#
# controls {
# inet 127.0.0.1 port 953
# allow { 127.0.0.1; } keys { "rndc-key"; };
# };
如果 /etc/named.conf 中包含有 controls 这一Section,先注释掉。
然后在后面添加一行 include "/etc/rndc.key";
这样做是为了安全考虑,否则可以直接copy到 named.conf 文件中。
inet / port 的意思是,在 本机运行一个 rndc 监听端口 ,允许本机执行 ndc 或 rndc 命令。
[root@example etc]# named -g
12-May-2010 11:15:03.197 starting BIND 9.3.6-P1-RedHat-9.3.6-4.P1.el5 -g
12-May-2010 11:15:03.211 adjusted limit on open files from 4096 to 1048576
12-May-2010 11:15:03.211 found 1 CPU, using 1 worker thread
12-May-2010 11:15:03.212 using up to 4096 sockets
12-May-2010 11:15:03.266 loading configuration from '/etc/named.conf'
12-May-2010 11:15:03.270 using default UDP/IPv4 port range: [1024, 65535]
12-May-2010 11:15:03.271 using default UDP/IPv6 port range: [1024, 65535]
12-May-2010 11:15:03.288 listening on IPv4 interface lo, 127.0.0.1#53
12-May-2010 11:15:03.311 listening on IPv4 interface eth1, 192.168.1.108#53
12-May-2010 11:15:03.312 listening on IPv4 interface vmnet1, 192.168.157.1#53
12-May-2010 11:15:03.313 listening on IPv4 interface vmnet8, 172.16.237.1#53
12-May-2010 11:15:03.336 listening on IPv4 interface virbr0, 192.168.122.1#53
12-May-2010 11:15:03.337 binding TCP socket: address in use
12-May-2010 11:15:03.395 command channel listening on 127.0.0.1#953
12-May-2010 11:15:03.396 ignoring config file logging statement due to -g option
12-May-2010 11:15:03.396 couldn't open pid file '/var/run/named/named.pid': Permission denied
[root@example etc]# chmod 777 /var/run/named/
[root@example etc]# named -g (檢查有無錯誤)
12-May-2010 11:24:08.058 starting BIND 9.3.6-P1-RedHat-9.3.6-4.P1.el5 -g
12-May-2010 11:24:08.059 adjusted limit on open files from 4096 to 1048576
12-May-2010 11:24:08.059 found 1 CPU, using 1 worker thread
12-May-2010 11:24:08.060 using up to 4096 sockets
12-May-2010 11:24:08.119 loading configuration from '/etc/named.conf'
12-May-2010 11:24:08.146 using default UDP/IPv4 port range: [1024, 65535]
12-May-2010 11:24:08.189 using default UDP/IPv6 port range: [1024, 65535]
12-May-2010 11:24:08.196 listening on IPv4 interface lo, 127.0.0.1#53
12-May-2010 11:24:08.198 listening on IPv4 interface eth1, 192.168.1.108#53
12-May-2010 11:24:08.198 listening on IPv4 interface vmnet1, 192.168.157.1#53
12-May-2010 11:24:08.223 listening on IPv4 interface vmnet8, 172.16.237.1#53
12-May-2010 11:24:08.224 listening on IPv4 interface virbr0, 192.168.122.1#53
12-May-2010 11:24:08.224 binding TCP socket: address in use
12-May-2010 11:24:08.273 command channel listening on 127.0.0.1#953
12-May-2010 11:24:08.273 ignoring config file logging statement due to -g option
12-May-2010 11:24:08.277 running
--------------------
Problem 2 : bash: etc/rndc.conf:Permission denied
Solution:
sudo sbin/rndc-confgen > etc/rndc.conf的前半部分权限的对的,只是后半部分不对。而不是一开始自己以为的使用named用户。
修改root用户密码:
sudo passwd root
输入当前普通用户的密码后,便可重新设置root密码
切换用户角色,su - 进入root用户
输入root新设置的密码后,顺利进入root权限,以后的操作就方便多了。
在root权限下,执行
sbin/rndc-confgen > etc/rndc.conf
顺利生成rndc.conf控制命令的key文件(注:符号指向:’>’是覆盖,’>>’是添加)
----------------------
Problem3 : named -g 產生
21-Jun-2013 17:08:17.705 /etc/bind/named.conf:15: expected quoted string near '“'
Solution :
(“)砍倒掉重打(")
connect failed: 127.0.0.1#953: connection refused的更多相关文章
- Bind 远程连接出现rndc: connect failed: 192.168.1.66#953: connection refused
远程连接IP地址为192.168.1.66的BIND DNS服务器,出现 rndc: connect failed: 192.168.1.66#953: connection refused 原因:1 ...
- rndc: connect failed: 127.0.0.1#953: connection refused
[root@localhost sbin]# ./named -v bind 9.5.1-p3-v3.0.9 问题现象: [root@localhost sbin]# ./rndc flush -p ...
- 解决git Failed to connect to 127.0.0.1 port xxxx: Connection refused
某天,用git拉取,提交代码的时候出现了git Failed to connect to 127.0.0.1 port xxxx: Connection refused的问题, 开始百度,看了一通.都 ...
- 【MongoDB】 Failed to connect to 127.0.0.1:27017, reason: Connection refused
由于项目需要,在一台虚拟机上安装了MongoDB,但是在启动的时候,出现如下错误: [root@localhost bin]# ./mongo MongoDB shell version v3.4.0 ...
- Failed to connect to 127.0.0.1 port 1080: Connection refused package 问题解决方法
错误: fatal: unable to access 'https://github.com/******': Failed to connect to 127.0.0.1 port 1080: C ...
- zabbix-Get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused
监控zabbix服务端这台服务器,然后显示Get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Conne ...
- 我遇到的错误curl: (7) Failed to connect to 127.0.0.1 port 1086: Connection refused
今天我用curl命令,无论如何都是出现: curl: (7) Failed to connect to 127.0.0.1 port 1086: Connection refused 找了很久,不知道 ...
- curl: (7) Failed to connect to 127.0.0.1 port 1086: Connection refused
今天我用curl命令,无论如何都是出现: curl: (7) Failed to connect to 127.0.0.1 port 1086: Connection refused 找了很久,不知道 ...
- git时 Failed to connect to 127.0.0.1 port 1080: Connection refused
在公司换了一台电脑之后发现git clone 和 npm install都失败,报错为 fatal: unable to access 'https://github.com/netease-im/N ...
随机推荐
- 金额格式化,例子:fmoney("12345.675910", 3),返回12,345.676
/** * 金额格式化 * 例子:fmoney("12345.675910", 3),返回12,345.676 * @data 备注lhh 2016-09-18 */ functi ...
- Compile Linux Kernel on Ubuntu 12.04 LTS (Detailed)
This tutorial will outline the process to compile your own kernel for Ubuntu. It will demonstrate bo ...
- node单线程
const fs=require('fs'); console.time('timer'); fs.stat('./1.txt',(err,stats)=>{ //console.log(sta ...
- html中插入css的4种方法
#1:链入外部样式表 <head> <link href="mystyle.css" rel="stylesheet" type=" ...
- 力扣—gray code (格雷编码) python实现
题目描述: 中文: 格雷编码是一个二进制数字系统,在该系统中,两个连续的数值仅有一个位数的差异. 给定一个代表编码总位数的非负整数 n,打印其格雷编码序列.格雷编码序列必须以 0 开头. 英文: Th ...
- oracle11g rename user导致物化视图失效的处理
在上一篇文章中,已经点到了数据库改名时,引起该schema下物化视图会失效的问题.从表面上看,该物化视图是删也删不掉,那当然就无法重建了.以下是实验过程: Oracle Database 11g En ...
- 理解CSV格式规范(解析CSV必备)
什么是CSV逗号分隔值(Comma-Separated Values,CSV),其文件以纯文本形式存储表格数据(数字和文本),文件的每一行都是一个数据记录.每个记录由一个或多个字段组成,用逗号分隔.使 ...
- Ubuntu更新完NVIDIA驱动后,重启电脑进入不了系统,一直处于登录界面
如题描述,我的系统是Ubuntu16.04,安装caffe的过程将一些驱动更新了,后来重启电脑时发现我进入不了系统了,输入我的登录密码会发现屏幕一闪,然后又重新跳回到登录界面,就是进入了login l ...
- MariaDB 选择查询
在本章中,我们将学习如何从表中选择数据. SELECT语句检索所选行. 它们可以包括UNION语句,排序子句,LIMIT子句,WHERE子句,GROUP BY ... HAVING子句和子查询. 查看 ...
- 四轴遥控器ADC部分
一.ADC参考手册学习 A/D转换可以按单次.连续设置采样:可以一一扫描或间断的对多个ADC通道进行采集. ADC的结果有左对齐和右对齐. ADC的输入时钟不得超过14Mhz,它是由PCLK2经分频产 ...