[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的更多相关文章

  1. 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 ...

  2. connect failed: 127.0.0.1#953: connection refused

    Problem1 : root@jeremy-VirtualBox:/etc/bind# /etc/init.d/bind9 restart * Stopping domain name servic ...

  3. 解决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的问题, 开始百度,看了一通.都 ...

  4. 【MongoDB】 Failed to connect to 127.0.0.1:27017, reason: Connection refused

    由于项目需要,在一台虚拟机上安装了MongoDB,但是在启动的时候,出现如下错误: [root@localhost bin]# ./mongo MongoDB shell version v3.4.0 ...

  5. 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 ...

  6. 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 ...

  7. 我遇到的错误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 找了很久,不知道 ...

  8. 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 找了很久,不知道 ...

  9. 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 ...

随机推荐

  1. c程序设计语言_习题8-6_利用malloc()函数,重新实现c语言的库函数calloc()

    The standard library function calloc(n,size) returns a pointer to n objects of size size , with the ...

  2. breakpoints、lldb 和 chisel 的使用

    http://www.cocoachina.com/ios/20150803/12805.html Breakpoints BreakPoint分类 breakpoint也是有分类的,我这里的文章内大 ...

  3. 【转】VS2010/MFC编程入门之二十五(常用控件:组合框控件Combo Box)

    原文网址:http://www.jizhuomi.com/software/189.html 上一节鸡啄米讲了列表框控件ListBox的使用,本节主要讲解组合框控件Combo Box.组合框同样相当常 ...

  4. 2016值得关注的语言平台、JS框架

    语言和平台 Python 3.5 在今年发布了,带来了很多新特性 比如 Asyncio,,为你带来了类似 node.js 的事件机制,还有type hints. 鉴于Python 3 终于真正地火起来 ...

  5. C# 操作 Word 修改word的高级属性中的自定义属性

    为 Microsoft Word 创建自动化客户端 启动 Visual Studio .NET. 在文件菜单上,单击新建,然后单击项目.从 Visual C# 项目类型中选择 Windows 应用程序 ...

  6. 嵌入式linux中使用 DHCP功能描述

    嵌入式linux中使用 DHCP功能描述 busybox中udhcpc的默认script脚本地址为#define DEFAULT_SCRIPT   CONFIG_UDHCPC_DEFAULT_SCRI ...

  7. 速冻熟食制品的QS的申请办法

    QS审核流程许可证申办程序食品生产加工企业按照下列程序申请获得食品生产许可证:1.食品生产加工企业按照地域管辖和分级管理的原则,到所在地的市(地)级以上质量技术监督部门提出办理食品生产许可证的申请:2 ...

  8. [Stephen]页面实现瀑布流源码

    项目中使用到的瀑布流代码 @using tZ.Pms.Biz @using tZ.Mvc.Base @model IPageInfo @{ ViewBag.Title = Model.WebTitle ...

  9. nyoj开心的小明

    这个问题是01背包,而对于编程之美那道是完全背包问题,在编程之美中也有一个0,1背包问题. 而且是容量是小于等于,不是等于,对于是否等于,在初始化参数时候不一样,不小于全部初始化为0,恰好等于,初始化 ...

  10. BeanPostProcessor 的使用,实现在对象初始化之前或者之后对对象进行操作

    import java.lang.reflect.Field; import org.springframework.beans.BeansException; import org.springfr ...