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 10056
rndc: connect failed: 127.0.0.1#953: connection refused
问题分析:
看报错认为rndc使用的953端口,将端口换为953后报同样的错误
首先看了下bind的named.conf文件
......
include "/home/alipms/zxtest/bind981/etc/rndc.key";
controls {
inet 127.0.0.1 port 10056 allow { 127.0.0.1; } keys { "rndc-key"; };
};
......
再看下rndc.key
key "rndc-key" {
algorithm hmac-md5;
secret "zwKd/d9neRFzJ8v/FVB8oA==";
};
最后查看了下bind的启动日志:
......
23-Jan-2014 08:47:55.106 command channel listening on 127.0.0.1#10056
......
可以确定rndc使用的是10056端口
[root@localhost sbin]# ./rndc -h
Usage: rndc [-b address] [-c config] [-s server] [-p port]
[-k key-file ] [-y key] [-V] command
......
可以看到是rndc命令输入有误
解决方式:
将命令换为:
[root@localhost sbin]# ./rndc -p 10056 flush
查看bind日志为:
23-Jan-2014 09:15:33.387 received control channel command 'flush'
23-Jan-2014 09:15:33.388 flushing caches in all views succeeded
PS:
可以使用rndc-confgen直接生成rndc.key,rndc-confgen和rndc在同一目录下
[root@localhost sbin]# ./rndc-confgen -h
Usage:
rndc-confgen [-a] [-b bits] [-c keyfile] [-k keyname] [-p port] [-r randomfile] [-s addr] [-t chrootdir] [-u user]
-a: generate just the key clause and write it to keyfile (/home/alipms/zxtest/bind981/etc/rndc.key)
-b bits: from 1 through 512, default 128; total length of the secret
-c keyfile: specify an alternate key file (requires -a)
-k keyname: the name as it will be used in named.conf and rndc.conf
-p port: the port named will listen on and rndc will connect to
-r randomfile: source of random data (use "keyboard" for key timing)
-s addr: the address to which rndc should connect
-t chrootdir: write a keyfile in chrootdir as well (requires -a)
-u user: set the keyfile owner to "user" (requires -a)
[root@localhost sbin]# ./rndc-confgen -p 10056 > ./rndc.key
查看生成的rndc.key
# Start of rndc.conf
key "rndc-key" {
algorithm hmac-md5;
secret "FT/3Iknv/lqLDlJFp9MkkQ==";
}; options {
default-key "rndc-key";
default-server 127.0.0.1;
default-port 10056;
};
# End of rndc.conf # Use with the following in named.conf, adjusting the allow list as needed:
# key "rndc-key" {
# algorithm hmac-md5;
# secret "FT/3Iknv/lqLDlJFp9MkkQ==";
# };
#
# controls {
# inet 127.0.0.1 port 10056
# allow { 127.0.0.1; } keys { "rndc-key"; };
# };
# End of named.conf
然后将注释部分:
key "rndc-key" {
algorithm hmac-md5;
secret "FT/3Iknv/lqLDlJFp9MkkQ==";
};
controls {
inet 127.0.0.1 port 10056
allow { 127.0.0.1; } keys { "rndc-key"; };
};
拷贝至named.conf文件中或拷贝至特定文件中,然后将该文件include至named.conf文件中即可
rndc: 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 ...
- connect failed: 127.0.0.1#953: connection refused
Problem1 : root@jeremy-VirtualBox:/etc/bind# /etc/init.d/bind9 restart * Stopping domain name servic ...
- 解决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 ...
随机推荐
- MVC——数据库增删改查(Razor)
一.显示信息 .Models(模板) private MyDBDataContext _context = new MyDBDataContext(); //定义一个变量取出所有数据 public L ...
- Discuz! x3.1的插件/utility/convert/index.php代码执行漏洞
漏洞版本: Discuz! x3.1及以下版本 漏洞描述: Discuz! x3.1的插件/utility/convert/index.php存在代码执行漏洞,如果用户在使用完之后不删除,会导致网站容 ...
- HtmlParser应用,使用Filter从爬取到的网页中获取需要的内容
htmlparser是一个纯的java写的html解析的库,它不依赖于其它的java库文件,主要用于改造或提取html.它能超高速解析html,而且不会出错.现在htmlparser最新版本为2.0. ...
- WinForm触摸屏程序功能界面长时间不操作自动关闭回到主界面 z
操作者经常会在执行了某操作后,没有返还主界面就结束了操作然后离开了,程序应该关闭功能窗体自动回到主界面方便下一位操作者操作.那么对于WinForm程序怎么实现呢? 实现原理:拦截Application ...
- 关于 unity5.3.1 录制 animation 带有 rotation 信息打包 Android 会运动错乱的问题
Unity5.3.1 录制 animation 带有 rotation 信息打包 Android 会运动错乱的问题 ,临时解决方法是:在动画面板中点击 rotation 属性,右键选择菜单中 ...
- WIN7中盾牌的编程-DELPHI
在PAR文件中引用UAC.RES文件(见下载地址) 代码如下: {$R uac.RES} 点击下载
- Git 钩子
1. 概念概述 1.1. 安装钩子 1.2. 脚本语言 1.3. 钩子的作用域 2. 本地钩子 2.1. 预提交钩子 Pre-Commit 2.2. 准备提交信息钩子 Prepare Commit M ...
- leetcode—pascal triangle
1.题目描述 Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows ...
- PHP字符串操作常用函数
/* * 确定字符串长度 * int strlen(string str) * 比较两个字符串 * 1.strcmp函数对两个字符串进行二进制安全的比较,并区分大小写 * int strcmp(str ...
- HW4.35
public class Solution { public static void main(String[] args) { double sum = 0; for(int i = 1; i &l ...